Goal : Create, modify and delete, … JIRA issues
Describe the different steps for connecting Magic xpi with JIRA cloud platform5 using REST API with Basic Auth or OAuth2
1/ Check with Postman the connection with your User and Password
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_1_-1024x474.png)
2/ (*) For OAuth2, define an apps in the atlassian developer console with desired scope and get all the credentials (Client ID, Client secret, Callback URL ).
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/07/JIRA_4-1-1024x588.png)
3/ (*) For OAuth2 Use Postman to test
Authorize URL : https://auth.atlassian.com/authorize?audience=api.atlassian.com
Access token URL : https://auth.atlassian.com/oauth/token
Scope : read:jira-work write:jira-work read:jira-user
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/07/JIRA_2.png)
(*) Future use OAuth2 (Execute a Get on https://api.atlassian.com/oauth/token/accessible-resources)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/07/JIRA_3_-1024x644.png)
(*) Future use for OAuth2 (Copy the id of your Jira project and Execute a GET on https://api.atlassian.com/ex/jira/<id>/rest/api/2/project)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_5-1024x653.png)
4/ Download Open API file from Atlassian from https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_6-1024x346.png)
5/ Open a Magic xpi project and define a REST Client Resource
Rename the Resource to « JIRA_REST_Basic » and set API Definition to « Open Api » and clic the « Load OpenAPI » button
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_7-1024x695.png)
6/ Click on « Paths » to discover all the endpoints available in other to play with JIRA
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_8-1024x483.png)
6/ Design a new flow and Drag and Drop the Rest Client connector.
Choose Path : /rest/api/3/issue/{issueIdOrKey} and Get operation and click OK
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_9-1024x455.png)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_10-1024x831.png)
Set the Jira issue name to issueIdOrKey field (« MAG-1 » in my case)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_11-1024x238.png)
7/ Execute the flow in Debug Mode.
You get the response in the C.UserBlob variable
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_12-1024x468.png)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_13-1024x491.png)
8/ To create a JIRA issue, you have to use the Data Mapper with the correct JSON schema in other to create the JSON request
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_15-1024x456.png)
9/ Drag And Drop REST Client connector and execute a POST on /rest/api/3/issue with the previous JSON (F.JSONrequest)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_16-1024x545.png)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_17-1024x433.png)
You should receive a 201 created in the status
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_19-1024x431.png)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_20-1024x481.png)
10/ After the REST Client Step, you can parse the response with the Datamapper and the Json schema to catch the JiraId and JiraKey
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_18-1024x244.png)
11/ To delete a JIRA issue, you need to have the correct right (see Delete permission in JIRA)
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_21-1024x436.png)
Drag And Drop REST Client connector and execute a Delete on the path : /rest/api/3/issue/{issueIdOrKey} and pass the Jira Issue Key
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_23.png)
You should receive status 204 No Content
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_22-1024x318.png)
8/ For OAuth2 authentification, you have to create a REST Client Magic xpi resource with « Security » set to « OAuth2 » and pass all the required parameters
![](https://france.magicsoftware.com/blog/wp-content/uploads/2024/08/JIRA_14-1-1024x564.png)
(*) uuid in the Server URL correspond to your Jira project id (see step 3)
(**) Currently the Access Token cannot be retrieved because of a technical issue … to continue