How to do a post/put request to the jira cloud field on a task?

I’m trying to do a post or put request to a jira cloud field within a task, and having trouble finding an answer to this. I know I can input the jira ticket url manually here(below), but I’m trying to automate the process through a web hook.

Jira cloud field seems to be an attachment based field. However, resource_subtype options within an attachment post request only include asana, box, dropbox, external, gdrive, onedrive, vimeo, so there’s no separate option for jira. If I want to do a post/put request for this type of attachment, I would have to do “external” as a resource_subtype, but if I do that, then it just shows up as a regular attachment, not as a jira cloud attachment.

This is the body parameter for an attachment:

file: string
name: string
parent: string
resource_subtype: external
url: string

The request is successful, but it’s showing up as a regular attachment, not as a jira cloud attachment. Is there a post/put example I can look at where I can successfully do a put/post request as a jira cloud attachment?

Hi @Dean_Kim and welcome to the forum!

The Jira cloud integration with Asana is not a simple matter of setting an attachment; it’s actually built on a whole new Asana technology framework called App Components. (That’s why you’re not seeing an attachment type for Jira.) So I don’t think you’ll be able to do what you’re wanting.

Having said that, it’s not 100% clear exactly what you’re trying to accomplish, so perhaps you could provide some more details (maybe a couple of screenshots of what you’re wanting to create, if appropriate).

1 Like

Hi @Phil_Seeman - thanks for the warm welcome! Yup, after that post, I realized Jira Cloud is actually a widget and I need to make a request to the App Server/Component. What I’m trying to do is the following:

image

Within a task for this particular field/attachment(?), I want to insert a jira issue link on “add existing issue”. I can do it manually by putting the jira ticket url, but I don’t see anything within the API documentation how I can automate this process (i.e. if i wanted to automate this process for a due date field, for example, I can do that with a put request through a web hook).

I understand I need to engage the App Component somehow, but how do I make a request to do that?

For other automation I’ve done so far from Jira to Asana for example, I’ve used zapier to pull in data from Jira and use that as a put request web hook to an Asana’s task to update different fields within that task. In a similar fashion, I want to be able to automate the Jira Cloud field/attachment the same way without having to manually input the Jira ticket url.

1 Like

You’re not going to be able to do any sort of formal API call to the Jira App Component; App Components are “closed systems”, not open API elements - that is, they’re build with the API but are themselves UI elements. Only Jira can do calls to their App Components endpoints.

Having said that, I think I recall it might be possible to add an attachment which, if it’s exactly right, would cause the widget to appear - you are correct that it’s the attachment that controls the widget. I know @Bastien_Siebman and @lpb were working on doing this - were you guys ever able to get an attachment to work properly to display an App Component widget?

1 Like

@Phil_Seeman and @Dean_Kim,

I agree with Phil’s assessment that you won’t be able to interact with the Jira widget through the API; you probably could through a Chrome extension but that’s usually not advised.

As for adding your own widget, I’m not sure if two different App Component widgets are allowed on a task; perhaps. Yes, I was able to get this working locally with the App Components example app and documentation.

Hope that helps (somewhat),

Larry

1 Like

Right, @lpb you can’t have more than one widget on a task. But @Dean_Kim wasn’t trying to add a second widget; he was hoping to instantiate the Jira widget by creating the exact same format of attachment that Jira does when its widget gets created. Didn’t you or Bastien try to do the same thing; add an attachment to get a widget to appear without actually having the widget created via the the App Component menu in the UI?

1 Like

Oh, well I wouldn’t call that creating the “Jira” widget which is easily confused with the official widget; this would be creating a custom widget and happening to put Jira info in it.

This should certainly be possible. @Bastien_Siebman didn’t initially get it working and hasn’t had time to return to debug what I think his issue was/is. But I recommend @Dean_Kim just follow the App Components and Attachment API documentation which describes how to do this.

1 Like

Theoraticaly, if you add the propre attachment that would cause the widget to appear indeed.

2 Likes

No, actually not. I checked with one of my contacts on the App Components team at Asana and @Dean_Kim I’m afraid I have bad news - it’s not possible to do what you want.

The reason is that when you create a Jira widget on a task “the right way” (i.e. through the UI), Jira stores some metadata about that task in its own data store. If you try to “simulate” that process by adding an attachment, then when Asana asks Jira for the contents of the widget, Jira will not find that metadata in its data store and won’t be able to tell Asana how to display the widget, and thus, no widget.

The only thing you could maybe do - @lpb kinda mentioned it above - is you could perhaps build your own App Component that mimics the behavior of the Jira App Component as much as possible. But IMO that’s not a very clean solution, and would be a LOT of work to accomplish even close to what you’re wanting.

1 Like

Hi @Phil_Seeman - yes, that’s exactly right in terms of what I’m trying to do.

I agree it will be too much work trying to creating a whole new app just to automate this process. Thank you very much for looking into it. Much appreciated!

1 Like

Hi Team,

We have successfully utilized Unito as an API to JIRA where it’s bidirectional push/pull of updates. It’s worked exceptionally well.

Hope this helps.

1 Like

What fields are you able to push/pull back and forth between JIRA and Asana using Unito? Does it work for custom fields on either platform? This is something I will likely want to look into, if so. Thank you!

There is a full list of fields for the Jira-Asana integration at Unito here Asana + Jira Integration | Unito Help Center9tj0pz_gaMTIxMTYyMjYyNi4xNjM4MzU2NDM5_ga_8Y49TBL1LY*MTYzODM1NjQzOS4xLjEuMTYzODM1NjcwMi4w

1 Like