Forums

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

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

Pramod Kushwaha
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!
January 24, 2019

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 Champion
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
AUG Leaders

Atlassian Community Events