Updating the Organizations field on an Issue using the Jira API
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
This article provides guidance on how to update the Organizations field on an issue using the Jira API.
Although there is an existing suggestion, JSDCLOUD-4605, for a dedicated endpoint to achieve this, the current method involves using the Edit issue API endpoint.
Solution
To update the Organizations field on an issue, follow these steps:
1. Obtain the Organization ID:
We can use the Get organizations API endpoint to retrieve the ID of the Organization you wish to update.
2. Identify the Custom Field ID:
Determine the custom field ID associated with the Organizations field in your Jira instance. You can use the below link for steps on how to get the custom field ID.
3. Use the Edit Issue API Endpoint :
With the Organization ID and the custom field ID, use the Edit issue API endpoint to update the Organizations field.
An example request is shown below:
Request:
https://{your_site}.atlassian.net/rest/api/2/issue/{issueIdOrKey}
Request Body:
{
"update": {
"customfield_10002": [4]
}
}
In this example , the custom field ID is 10002, and the Organization ID is 4.