The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get or update issue by custom field or meta data - without issue ID

Nour Dandan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 8, 2024

Situation : I will be creating issues via the rest API from a CRM.  Since I cannot force the issue ID on creation and since I'm unable to store the response in some sort of DB, I won't be able to update these issues via API.

 

Was thinking of setting a custom field or meta data containing that ID from the CRM and then use it to get the issue or simply update the issue directly, yet these are always requiring an issue ID or key.

 

Any thoughts? Suggestions?

 

Edit: found a solution to my issue so I don't have to use a DB. Yet the question itself is still valid for future reference ;) 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Tuncay Senturk _Snapbytes_
Community Champion
December 8, 2024

Hi @Nour Dandan 

This is a common scenario when integrating external systems with Jira. I listed the steps below that I'd follow to achieve such an integration

- create a custom Field in Jira (name it as CRM ID)

- send this CRM ID during the issue creation (or update)

URL: /rest/api/2/field

body: 

{
"fields": {
"summary": "Issue from CRM",
"project": {"key": "PRJ"},
"issuetype": {"name": "Task"},
"customfield_XXXXX": "CRM-12345"
}
}

 where PRJ is the project key, XXXXX is the customfield id for CRM ID field and CRM-12345 is the CRM ID.

- use JQL to searching the issue

GET /rest/api/2/search?jql=customfield_XXXXX="CRM-12345"

- update the issue using the key

PUT /rest/api/2/issue/PROJECT-123

{
"fields": {
"summary": "Updated issue summary"
}
}

I hope this was helpful

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events