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

Pramod Kushwaha 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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