Forums

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

Servicedesk rest api create request with Organization

Chris House
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!
September 19, 2019

I am trying to create a servicedesk request with a specified Organization to set on the request when it is created. I tried to use organizationId as a field in my request json but it is not recognized. I am able to create a request otherwise without an organization, so how can I create one with an Organization, or set the Organization afterward?

I am able to use /rest/servicedeskapi/servicedesk/${JIRA_PROJECT_ID}/organization to get the organization IDs associated with the project. I do get a warning that the API is Experimental. 

Using JIRA Service Desk 4.4.1.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>500</status-code><message>Unrecognized field "organizationId" (Class com.atlassian.servicedesk.api.rest.dto.domain.request.RequestCreateDTO), not marked as ignorable
at [Source: org.apache.catalina.connector.CoyoteInputStream@2852b1e1; line: 1, column: 280] (through reference chain: com.atlassian.servicedesk.api.rest.dto.domain.request.RequestCreateDTO["organizationId"])</message><stack-trace>org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "organizationId" (Class com.atlassian.servicedesk.api.rest.dto.domain.request.RequestCreateDTO), not marked as ignorable

 

1 answer

1 accepted

0 votes
Answer accepted
Brant Schroeder
Community Champion
September 19, 2019

Chris,

 Organization is just a custom field in Jira.

pic.PNGYou would just add something similar to this to your API call:

# Set Organization (using custom field id explicitly)
issue.update(fields={'customfield_12100': [2]}) # 2 is the ID of the organization on the project
Chris House
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!
September 21, 2019

Well of course it is. Thanks, didn't realize that.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events