• We collect Jira Service Desk feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      NOTE: This suggestion is for JIRA Service Desk Server. Using JIRA Service Desk Cloud? See the corresponding suggestion.

      Using JIRA's REST api, you can't set the Organization field using edit:
      https://docs.atlassian.com/jira/REST/cloud/#api/2/issue-editIssue

      When trying to set it, it throws a 500 Internal Server Error.

            [JSDSERVER-4353] Add REST support for setting Organization on a ticket - Server

            Used this to get the id.  Just did it in my browser.

             

            https://<yoururl>/rest/servicedesk/1/organisations/project/10003/search?query=<name of org>

            Cory Galloway added a comment - Used this to get the id.  Just did it in my browser.   https://<yoururl>/rest/servicedesk/1/organisations/project/10003/search?query=<name of org>

            Just answered my own question - it was probably a dumb one, but I am new to the JIRA REST APIs.

            I also had to do a lot of trial and error for this, and undoubtedly would have burned more without your post Nick. 

            The format that worked for me was. Hopefully this helps someone.

            {
                    "fields": {
                        "customfield_11300": [8]
                    }
                }
            

             

            Brett Larson added a comment - Just answered my own question - it was probably a dumb one, but I am new to the JIRA REST APIs. I also had to do a lot of trial and error for this, and undoubtedly would have burned more without your post Nick.  The format that worked for me was. Hopefully this helps someone. {          "fields" : {              "customfield_11300" : [8]         }     }  

            @Nick Menere - That doesn't seem right: shouldn't the format include the custom field ID? is this through the JSD or JIRA API?

            Brett Larson added a comment - @Nick Menere - That doesn't seem right: shouldn't the format include the custom field ID? is this through the JSD or JIRA API?

            FYI, this is the format needed - (needed a lot of trial and error)

            {
                "fields": {
                    "Organizations": [1]
                }
            }
            

            Nick Menere added a comment - FYI, this is the format needed - (needed a lot of trial and error) { "fields" : { "Organizations" : [1] } }

            It may be useful to know that the JSD REST API has some resources to request all organizations, as well as all organizations for a Service Desk. In a REST context, this may assist in mapping a name to an id?

            In regards to the implementation of edit issue taking only ID's, this is something that could potentially be expanded in the future, however the current implementation is the simplest way to ensure complete compatibility with how the Custom Field works, as all issue data for this field is stored by ID.

            Matthew McMahon (Inactive) added a comment - It may be useful to know that the JSD REST API has some resources to request all organizations, as well as all organizations for a Service Desk. In a REST context, this may assist in mapping a name to an id? In regards to the implementation of edit issue taking only ID's, this is something that could potentially be expanded in the future, however the current implementation is the simplest way to ensure complete compatibility with how the Custom Field works, as all issue data for this field is stored by ID.

            Thanks for the reply Matthew McMahon.

            Figured it out in the end.

            The difficulty with the implementation of the Organisation field is that:

            1. There is no current method in the REST API to get an Organisation ID based on the Organisation Name. See https://docs.atlassian.com/jira-servicedesk/REST/cloud/#servicedeskapi/organization-getOrganization
              1. You can page through all the Organisations searching based on Organisation name, but that's far from optimal
            2. So knowing the Organisation ID value, required for the Organisation field is not straight forward.

            Setting the Organisation Name OR the Organisation ID in the Organisations field would make the Organisations field much easier to use via REST.

            My current workaround is to ADD the Organisation again as a Customer to JIRA Service Desk via REST. Which returns the Organisation ID on success. This is then used to set the Organisation field via REST.

            Not pretty, but it works.

            Justin Freeman added a comment - Thanks for the reply Matthew McMahon. Figured it out in the end. The difficulty with the implementation of the Organisation field is that: There is no current method in the REST API to get an Organisation ID based on the Organisation Name. See https://docs.atlassian.com/jira-servicedesk/REST/cloud/#servicedeskapi/organization-getOrganization You can page through all the Organisations searching based on Organisation name, but that's far from optimal So knowing the Organisation ID value, required for the Organisation field is not straight forward. Setting the Organisation Name OR the Organisation ID in the Organisations field would make the Organisations field much easier to use via REST. My current workaround is to ADD the Organisation again as a Customer to JIRA Service Desk via REST. Which returns the Organisation ID on success. This is then used to set the Organisation field via REST. Not pretty, but it works.

            justin222644402 the Organisation custom field has been updated to properly support the JIRA Edit Issue REST API, as described at https://docs.atlassian.com/jira/REST/server/#api/2/issue-editIssue

            You will need to know the custom field id, and organisations value can be set by using Organisation IDs

            Matthew McMahon (Inactive) added a comment - justin222644402 the Organisation custom field has been updated to properly support the JIRA Edit Issue REST API, as described at https://docs.atlassian.com/jira/REST/server/#api/2/issue-editIssue You will need to know the custom field id, and organisations value can be set by using Organisation IDs

            Justin Freeman added a comment - - edited

            Matthew McMahon thanks for releasing this, so what is the REST API to set an Organization on a ticket? Any docs?

            Justin Freeman added a comment - - edited Matthew McMahon thanks for releasing this, so what is the REST API to set an Organization on a ticket? Any docs?

            This has been fixed in JSD Server version 3.3.2. If you require this in Cloud, please watch the ticket JSD-4875 for updates

            Matthew McMahon (Inactive) added a comment - This has been fixed in JSD Server version 3.3.2. If you require this in Cloud, please watch the ticket JSD-4875 for updates

            RomeoA added a comment -

            Up?

            RomeoA added a comment - Up?

              Unassigned Unassigned
              299f0f7aaa75 Nick Menere
              Votes:
              12 Vote for this issue
              Watchers:
              22 Start watching this issue

                Created:
                Updated:
                Resolved: