We would like to integrate the jira webhook to our iOS app to bring the bug report functionality to our user.
The webhook is configured and working fine as whenever the user do a report (making a POST call from the app with the payload) it creates a JIRA ticket for that issue. however to make it even better, we want to allow users to attach images to the bug report. So the image can also be attached to the ticket.
How to do that?
Hi @Mo
You can use Jira's upload attachment REST Api for that.
POST /rest/api/3/issue/{issueIdOrKey}/attachments
Thanks @Tuncay Senturk _Snapbytes_ ,
I already looked at this REST Api, however in my case, when calling the webhook, there is not issue created yet (that's going to be handled by the webhook trigger)
Therefore I don't have the issue id/number to use this api to attach to it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, I see!
As far as I know, the Jira REST API does not allow you to attach a file at the same time as creating an issue in a single request. You have to do this in two sequential API calls.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the tip Tuncay!
What I am doing now is to make a first call to the webhook, to trigger the issue creation, then making a second call to search/fetch the id of the created issue, then making a third call to upload the attachment for that issue.
This is working for now, but for the sake of managing the API token, I guess we need to implement something in the backend to manage the token handling.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Mo
The create REST method (POST /rest/api/3/issue) already returns the issue ID / key. I do not understand why there is a need to make the second call to retrieve them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the idea is to create the issue through a trigger by the webhook, and not by making a POST call. This way we trigger the automation in the Service Desk Management.
Does calling the `/rest/api/3/issue` can be configured to create the issue under the JSD?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.