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

1 vote
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events