Getting error while create issue with environment field.

Arihant Jain March 28, 2018

Hi Team,

I am trying to create issue using servicedesk API with following parameter:

URL: https://spherewms.atlassian.net//rest/servicedeskapi/request

Project Key - SS


POST Payload:

{
    "serviceDeskId":"1",
    "requestFieldValues":{
    "summary":"Test",
    "description":"Testing",
    "customfield_11802":{
              "value": "10905"

      }
},
    "requestTypeId":"59"

}

 

Here custom field(customfield_11802) represent the Environment in request type.

I am not able to create ticket in and getting this error,

{
   "errorMessage": "Unable to create request because of theses errors : Field with id    'customfield_11802' named 'Environment' has these errors : Option value '10905' is not    valid",
  "i18nErrorMessage": {
  "i18nKey": "sd.request.create.error.failed.msg",
  "parameters": [
   "Field with id 'customfield_11802' named 'Environment' has these errors : Option value     '10905' is not valid"
 ]
 }
}

Any help would be really great for me.

Regards

Arihant Jain

 

2 answers

0 votes
Alexey Matveev
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.
March 29, 2018

If 10905 is the option id then your json should be like this

 

{
    "serviceDeskId":"1",
    "requestFieldValues":{
    "summary":"Test",
    "description":"Testing",
    "customfield_11802":{
              "id": "10905"

      }
},
    "requestTypeId":"59"

}

0 votes
Nic Brough -Adaptavist-
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.
March 28, 2018

Have a look at the options for the environment field in the list of custom fields, I suspect you will find that you don't have a value with key 10905 on it.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events