Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,296,507
Community Members
 
Community Events
165
Community Groups

How to create customer request via JIRA service desk rest APIs.

I am facing an issue while adding a custom field value Using Jira service desk APIs

getting the error message: "Unable to create request because of theses errors : The field 'customfield_10080' is not valid for this"

please check below code. I am using PHP for a scripting language GuzzleHttp for CURL request.

$client = new Client();

// parameters example

$requestArray['summary'] = 'Request created via Rest APIs';
$requestArray['description'] = 'I need a new *mouse* for my Mac';
$requestArray['labels'] = 'Computer';
$requestArray['customfield_10080'] = "32";

$result = $client->request('POST'
, 'https://dummy.atlassian.net/rest/servicedeskapi/request/'
, ['auth' => ['dummy@dummy.com', 'XXXXXX']
, 'json' => ['serviceDeskId' => 1, 'requestTypeId' => 15, 'requestFieldValues' => $requestArray]]);
$finalStory = \GuzzleHttp\json_decode($result->getBody()->getContents(), true);
print_r($finalStory);

exit;

 

1 answer

0 votes
Brant Schroeder Community Leader May 26, 2022

@Pramod Kushwaha Is that custom filed in the scheme for the project and issue type associated with the request type?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

320 views 0 10
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you