Forums

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

Creating customers with custom fields via API in Atlassian.

pedro_saavedra November 13, 2024

 

I am trying to create customer detail fields in Jira Service Management (JSM) using the API. I am using the following curl command:

curl --request POST \ --url 'https://api.atlassian.com/jsm/csm/cloudid/{cloudId}/api/v1/customer/details' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "name": "Region", "type": { "name": "SELECT", "options": [ "AU", "EU", "US" ] } }'

However, when I execute this command, I receive a 404 error with the following message:

404 Oops, you found a dead link. Navigate to the previous page Navigate to the Home Page Atlassian JIRA Project Management Software (v1001.0.0-SNAPSHOT#100275-Rev:1663ce7) About JIRA Report a problem Atlassian

I have attempted to resolve the issue by:

  • Verifying that the endpoint URL is correct.
  • Checking my authentication credentials and permissions.
  • Looking for similar issues in forums and communities.

Despite these efforts, the error persists. It seems that others might have experienced similar issues, but I haven't found a solution that works for me.

Request for Assistance:

  • Is there an updated or correct endpoint I should be using to create customer detail fields via the API?
  • Are there specific permissions or authentication methods required for this operation?
  • Has this functionality changed or been deprecated?

Any guidance or assistance in resolving this issue would be greatly appreciated.

Thank you.

1 answer

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.
November 14, 2024

HI @pedro_saavedra 

Welcome to the community.

I made this call via postman and it executes successfully.

Did you get your {cloudId} via: https://my-site-name.atlassian.net/_edge/tenant_info 

Replace my-site-name with your site name and replace {{cloudId}} in the request with the number found, without the "

pedro_saavedra November 14, 2024

 

 

I have performed the action using the specified Cloud ID in the link: https://miempresa.atlassian.net/jsm/csm/cloudid/[cloudidnumber]/api/v1/customer/details It’s still not working for me. I copied the Cloud ID number directly from the mentioned site and tried with users of different permission levels, but I’m still experiencing the same issue.

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.
November 14, 2024

So you use this ID starting with 7051f366-...

And the API call: 

https://api.atlassian.com/jsm/csm/cloudid/7051f366-.../api/v1/customer/details

pedro_saavedra November 14, 2024
yes, that is what i am doing.

 

pedro_saavedra November 14, 2024

But returning to the core of the question, I need to know how to send clients with more fields than those that appear in the creation API.

 

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.
November 14, 2024

Hi @pedro_saavedra 

This should work, I tested it via postman and this works flawless.

Try to to this via postman and if this does work, there is an issue

pedro_saavedra November 14, 2024

 

I used the following, with post method, with basic authentication, but it still doesn't work, now it throws, {"errorMessage":"Encountered error while executing request.","errors":["INTERNAL_SERVER_ERROR"],"statusCode":500}

 

https://api.atlassian.com/jsm/csm/cloudid/60xxxx-xxxx-xxx-xxxx-xxxxxxxxx/api/v1/customer/details

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.
November 14, 2024

I do this in postman and all works as expected, so there is a flaw in your call.

The endpoint is correct and works.

Variables I use and I use basic auth with my user and related api token

Screenshot 2024-11-14 at 16.59.39.png

post information and result

Screenshot 2024-11-14 at 16.58.52.png

pedro_saavedra November 14, 2024

 

Translator

 

What type of authentication do you use?

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.
November 15, 2024

HI @pedro_saavedra 

Basic auth.

email + api token

pedro_saavedra November 15, 2024

 

I use the same data provided, with the corresponding cloudid + the basic auth, but it still does not generate the desired return.
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.
November 15, 2024

Hi @pedro_saavedra 

Contact Atlassian Support in this case.

The endpoint is up and running. 

Are you assigned a JSM license or are you just Jira admin?

I'm both.

Suggest an answer

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

Atlassian Community Events