Create Zendesk ticket from Jira Issue
Create ticket from issue
Goto Integrations
Click New
Enter a name, we will call it: Create Zendesk ticket from issue
Select Template application/json
Click Create
Edit the action details
Select method
POST
Add URL
{your_instance_url}/api/v2/tickets
In the Authentication method select list select the credential created earlier (Token or OAuth)
In the Body section add
{ "ticket": { "comment": { "body": "{{issue.description}}" }, "priority": "urgent", "subject": "{{issue.summary}}" } }
Note. it is recommended to add the base url to your zendesk instance as a Variable to easier refer to it in further actions. We will add a static variable called zendesk. This will make our call look like this {{zendesk}}/api/v2/tickets
Second note. if priority needs to be mapped then Groovy can be used to make the mapping see Mapping of priority. We will hard code it in this tutorial.
Â
Add Trigger
Click on the Triggers & Condition tab
We will use the Issue Created as event to when to send the issue to zendesk
Use the condition Run only on these project(s) and/or JQL and select the Jira project that will be the source for all Zendesk issues
Click Save
Add a Action to set the ID from the Zendesk ticket in the Jira Issue
Click Create (top menu)
Select Action and enter a name: Add Zendesk ticket number to issue
Select Template Category: Jira Core Server
Select Template: Edit IssueÂ
Click Create
In the configuration select a authentication user to use when updating the Jira issue (Basic Auth)
In the body section paste the code in below and change the customfield id to match your field.
{
"fields":{"customfield_10201":"{{id}}"}
}
Note. If you have not setup a field to add the ticket number in from external system, then add a new Text field in Jira and add that to the Jira project, context and screen.
Testing
Goto the project that was selected in the Run only on these project(s) and/or JQL and create an issue with description.
Result should be a 201 OK