Forums

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

Are there any API requests available for organization detail fields?

Jaanika Talvistu December 15, 2023

We have found this documentation and have added these detail fields under the organizations:
https://support.atlassian.com/jira-service-management-cloud/docs/manage-organization-detail-fields/

 

But is there a way to use API requests to update these fields as well? I only found Property values but this does not seem to be the same thing, we need the detail field API requests.

 

3 answers

0 votes
Kevin Smith
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 20, 2023

I'm on the search for the same thing. This documentation looks like it could be an answer, but I still haven't been able to get it to work: https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/

I cannot understand why this isn't part of the JSM API. Boggles the mind.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 21, 2023

Hi @Kevin Smith and @Jaanika Talvistu 

Try to see it the put property option can achieve this.

The call will set new information, there is no option to update I think, so the existing will be overwritten.

The following request at Atlassian seems on this topic, you could follow this and see if any progress will be mad on it. JSDCLOUD-5966 

Gwenaël Durand
Contributor
January 16, 2024

@Kevin Smith and @Jaanika Talvistu   did you find a solution?

I'm just trying to GET the organization detail fields using the REST API.

Although my organizations do have several detailed fields, the Get Property Keys rquest https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-property-get  returns an empty list.

Like Lemonia Vavoulogianni likes this
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2024

Hi @Gwenaël Durand @Kevin Smith @Jaanika Talvistu 

You can create detail fields under the organizations, these are the same as in the API mentioned organization proerties, as the have been given an ID on creation.

https://support.atlassian.com/jira-service-management-cloud/docs/manage-organization-detail-fields/

You can NOT set values for these fields via the API, you only get details about the field and you are able to create them via the JSM API, 

Also the values you set in those fields/properties, is not searchable in JQL or via the API.

See this open issue at Atlassian: https://jira.atlassian.com/browse/JSDCLOUD-5966

Gwenaël Durand
Contributor
January 18, 2024

Hi @Marc - Devoteam ,

thanks for your feedback.  This is exactly  what I try to do. Let say I have the following organization in my project.  I'm trying to get the values of the fields "Product", "Version..." etc...

test.png

Here is what I do: 

* Retrieve the organization list using a GET on https://mydomain.atlassian.net/rest/servicedeskapi/organization  

* then I pick the one in the image above (let's say ID=39) and request this organisation as follows: https://mydomain.atlassian.net/rest/servicedeskapi/organization/39

This returns: {"id":"39","name":"Test Inc.","_links":{"self":"https://mydomain..../organization/39"}}

Now, my understanding is that you can get the list of the organization detail fields (their keys, actually) using: https://mydomain.atlassian.net/rest/servicedeskapi/organization/39/property

 

But this does not return anything else but: {"keys":[]}

 

Whatever the organisation I'm trying...

Like # people like this
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 19, 2024

Hi @Gwenaël Durand 

I have the same behaviour here.

I would urge you to raise a bug at Atlassian Support on this en mention the option given in the API don't functon.

Gwenaël Durand
Contributor
January 26, 2024

done. waiting for feedback

Johan Nilsson
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!
February 7, 2024

Hi,

To access the detail fields, please see the Customer Service Management APIs:

https://developer.atlassian.com/cloud/customer-service-management/rest/v1/intro/#about

Gwenaël Durand
Contributor
February 7, 2024

Correct,   

I just got feedback from Atlassian support:  they seem to confirm they have an issue with the Service Desck REST API above.

But the fields are available thought their CSM API on the link you mentionned.   

Works for me, at least to retrieve all the fields at once in a big JASON

Adam Zetocha
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!
March 22, 2024

Hi @Gwenaël Durand

which API call have you used to retrieve the fields from CSM API? I can't seem to locate the one that would be helpful in this case. 

Gwenaël Durand
Contributor
March 22, 2024

Hi Adam,

You can get the property using this endpoint :https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/#api-api-v1-organization-organizationid-get
using: --url '{host}/{basePath}/api/v1/organization/...
* host is always https://api.atlassian.com
* base path is jsm/csm/cloudid/{cloudId},

cloud site Id is given by: https://<your domain>.atlassian.net/_edge/tenant_info

So, end point to get the Organization details is : https://api.atlassian.com/jsm/csm/cloudid/<PUT YOUR CLOUD SITE ID>/api/v1/organization/<ORGANIZATION ID>

 

Gwenaël

Like # people like this
Adam Zetocha
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!
April 3, 2024

Hey @Gwenaël Durand ,

I managed to make it work. Thank you for the help!

Kind regards,

Adam

Like Gwenaël Durand likes this
Lemonia Vavoulogianni May 9, 2024

But what @Gwenaël Durand explained is a very valuable information that should be also somehow available in documentation. Is it already there?

By the way I was struggling with that API call and for me it also worked using this advice.

Danny Bouman May 15, 2024

@Gwenaël Durand But how do you update that property?

Gwenaël Durand
Contributor
May 15, 2024

the fiels are updated from the JSM project itself, from the Organization details. 

You can edit the value of the field directly on the left side, or add new fields in "Edit details" menu

Capture d’écran 2024-05-15 à 22.34.14.png

 

Gwenaël Durand
Contributor
May 15, 2024

Ok, sorry I may have missunderstood your question: i did try to update from the API.

This could be useful, also. If you find out, please share. :)

 

Danny Bouman May 15, 2024

Yes thanks for that but I knew that @Gwenaël Durand 

But once I have the fields how can I fill them using the API? 

This implies you can enter the values using the API: https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/#api-api-v1-organization-organizationid-details-put

But I can't get it to work, do you have that working and if so could you provide that call? (without personal details ofc)

Danny Bouman May 15, 2024

I keep getting: Error updating organization 6: {"errorMessage":"Internal server error","errors":["INTERNAL_SERVER_ERROR"],"statusCode":500} 

Back, not really something I can work with

Gwenaël Durand
Contributor
May 15, 2024

As said, I never tried.  Data are entered manually at the moment.

Sorry for that, @Danny Bouman

Sufian Reiter
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!
June 17, 2024

I hope I can shed some light for the people who are still having this problem

I have managed to both get the organization details and set the value for an organization detail using the customer service management API:

GET 

config = {
'base_url': f"https://api.atlassian.com/jsm/csm/cloudid/your-cloud-instance-id/api/v1/organization/your-organization-id",
'email': 'your-email/user',
'api_token': 'your api-token/password'
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
query = {
"fieldName": "Account Manager"
}
payload = json.dumps(
{"values": ["your new value"]}
)
response = requests.get(url=config['base_url'], auth=HTTPBasicAuth(config["email"], config["api_token"]),
headers=headers)



PUT

config = {
'base_url': f"https://api.atlassian.com/jsm/csm/cloudid/your-cloud-instance-id/api/v1/organization/your-organization-id/details",
'email': 'your-email/user',
'api_token': 'your api-token/password'
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
query = {
"fieldName": "Account Manager"
}
payload = json.dumps(
{"values": ["your new value"]}
)
response = requests.put(url=config['base_url'], auth=HTTPBasicAuth(config["email"], config["api_token"]),
headers=headers, data=payload, params=query)
Kevin Smith
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 24, 2024

@Danny Bouman Make sure you're obtaining the correct cloud ID from https://confluence.atlassian.com/jirakb/how-to-find-cloud-site-id-1272283178.html#:~:text=Solution,atlassian.net%2F_edge%2Ftenant_info

I was getting the 500 Internal Server Errors too, and it was because I was literally loading https://my-site-name.atlassian.net/_edge/tenant_info to get my cloud ID and not replacing my-site-name in the URL with my company's site name.

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 15, 2023
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 8, 2024
0 votes
Albert Manuel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 15, 2023

You should be able to do it with the explanation from here: https://jira.atlassian.com/browse/JSDCLOUD-4605

Jaanika Talvistu December 15, 2023

No, I don't need to update the name of the organization. I need to update the detail fields under the organization.

Suggest an answer

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

Atlassian Community Events