Are there any API requests available for organization detail fields?
Asked by Jaanika Talvistu:

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](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-property-propertykey-get) values but this does not seem to be the same thing, we need the detail field API requests.


Answers:
author: Kevin Smith
body: 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](https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-get). Boggles the mind.

comments: author: Marc - Devoteam
body: Hi [@Kevin Smith](/t5/user/viewprofilepage/user-id/2940010) and [@Jaanika Talvistu](/t5/user/viewprofilepage/user-id/4250908)

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](https://jira.atlassian.com/browse/JSDCLOUD-5966)


author: Gwena?l Durand
body: [@Kevin Smith](https://community.atlassian.com/t5/user/viewprofilepage/user-id/2940010) and [@Jaanika Talvistu](https://community.atlassian.com/t5/user/viewprofilepage/user-id/4250908) 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.


author: Marc - Devoteam
body: Hi [@Gwena?l Durand](/t5/user/viewprofilepage/user-id/5225968) [@Kevin Smith](/t5/user/viewprofilepage/user-id/2940010) [@Jaanika Talvistu](/t5/user/viewprofilepage/user-id/4250908)

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>


author: Gwena?l Durand
body: Hi [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976) ,

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](https://community.atlassian.com/t5/image/serverpage/image-id/301329iD7394C01B7CABD1A/image-dimensions/221x201?v=v2 "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...


author: Marc - Devoteam
body: Hi [@Gwena?l Durand](/t5/user/viewprofilepage/user-id/5225968)

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.


author: Gwena?l Durand
body: done. waiting for feedback


author: Johan Nilsson
body: 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>


author: Gwena?l Durand
body: 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


author: Adam Zetocha
body: Hi [@Gwena?l Durand](/t5/user/viewprofilepage/user-id/5225968)

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.


author: Gwena?l Durand
body: 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


author: Adam Zetocha
body: Hey [@Gwena?l Durand](/t5/user/viewprofilepage/user-id/5225968) ,

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

Kind regards,

Adam


author: Lemonia Vavoulogianni
body: But what [@Gwena?l Durand](/t5/user/viewprofilepage/user-id/5225968) 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.


author: Danny Bouman
body: [@Gwena?l Durand](https://community.atlassian.com/t5/user/viewprofilepage/user-id/5225968) But how do you update that property?


author: Gwena?l Durand
body: 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?e?cran 2024-05-15 a? 22.34.14.png](https://community.atlassian.com/t5/image/serverpage/image-id/323974i9C8E0D5EB218C688/image-size/large?v=v2&px=999 "Capture d?e?cran 2024-05-15 a? 22.34.14.png")


author: Gwena?l Durand
body: 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. :)


author: Danny Bouman
body: Yes thanks for that but I knew that [@Gwena?l Durand](https://community.atlassian.com/t5/user/viewprofilepage/user-id/5225968)   

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)


author: Danny Bouman
body: 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


author: Gwena?l Durand
body: As said, I never tried. Data are entered manually at the moment.

Sorry for that, [@Danny Bouman](/t5/user/viewprofilepage/user-id/5464752)


author: Sufian Reiter
body: 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)
```

<br />

<br />

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)
```


author: Kevin Smith
body: [@Danny Bouman](/t5/user/viewprofilepage/user-id/5464752) 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](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.


author: Marc - Devoteam
body: Hi [@Jaanika Talvistu](/t5/user/viewprofilepage/user-id/4250908)

I think you are looking to use the JSM API and the put property option.

See <https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-organization-organizationid-property-propertykey-put>

comments: author: Marc - Devoteam
body: Hi [@Jaanika Talvistu](/t5/user/viewprofilepage/user-id/4250908)

you could use the following:

<https://developer.atlassian.com/cloud/customer-service-management/rest/v1/api-group-organization/#api-api-v1-organization-organizationid-details-put>


author: Albert Manuel
body: You should be able to do it with the explanation from here: **<https://jira.atlassian.com/browse/JSDCLOUD-4605>**

comments: author: Jaanika Talvistu
body: No, I don't need to update the name of the organization. I need to update the detail fields under the organization.


Tags: cloud

jira-service-management

jira-service-management-cloud