rest api create issue problem with request type from AO_54307E_VIEWPORTFORM table

llagos February 11, 2019

Hi. I'm trying to create an issue using Jira API and need to fill the customer request Type.

According to doc, I need to get the "customer request type" as follows:

https://confluence.atlassian.com/jirakb/how-to-set-request-type-when-creating-an-issue-via-rest-api-using-rest-api-2-issue-endpoint-938041214.html

I looked into that table, KEY has this values, for Viewport-id = 4 (the project number from the URL in the portal):

name key VIEWPORT_ID
Incident f5abfb34-b191-40c0-8666-33bc07634022 4
Requirement 08d71935-7739-4dd7-8b5e-032291aaeb18 4

So my JSON looks like this:

$ cat dvcor-create-issue-11fields.json
{
"fields":
{
"project" : { "id": "10300" },
"issuetype" : { "id": "10002" },
"reporter" : { "name": "llagos"},
"summary" : "Requerimiento creado via JSD REST API",
"description" : "Ejemplo desde API Jira Core",
"customfield_10001": "DVCOR/f5abfb34-b191-40c0-8666-33bc07634022",
"customfield_10704": "extension 5942",
"customfield_10400": { "id": "10204" },
"customfield_10325": { "id": "10112" },
"customfield_10322": [{ "key": "SER-3695" } ],
"customfield_10717": [{ "key": "GRES-8461" } ],
"customfield_10408": [{ "key": "SER-16" } ],
"customfield_10412": [{ "key": "SER-33593" } ],
"customfield_10413": [{ "key": "SER-33596" } ]
}
}

However, I'm getting the following error:

{
"errorMessages": [],
"errors": {
"customfield_10001": "Value of customer request invalid"
}
}

So, what am I doing wrong?

Thanks for any hint!

1 answer

1 accepted

1 vote
Answer accepted
Martina Riedel
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.
August 16, 2019

try to use the project key in lower case

Jaesang Kim January 7, 2020

I'm having a same issue. It seems using lower case of project key works for him but it's not working with mine.   my project key is "SDSAITSD" and key value is like "85d5823b-5d68-4491-930b-a834963ec3xx" so i put a value of "sdsaitsd/85d5823b-5d68-4491-930b-a834963ec3xx"  then I got this error message "invalid customer request value".  any suggestion? thanks a lot! 

Martina Riedel
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.
January 7, 2020

the value in the DB is the original project key in lower case. If the project was rekeyed, you have to know what it was originally.

so if it originally was MYKEY and was rekeyed to SDSAITSD, you need to use "mykey/85d5823b-5d68-4491-930b-a834963ec3xx"

Like Jaesang Kim likes this
Jaesang Kim January 7, 2020

Thank you for your suggestion. 8)  

Kyle Keefer August 19, 2020

@Martina Riedel's comment is what solved this for me.

 

For anyone else who may be struggling with this, if you are using the following endpoint to get your request type key value:

/rest/servicedesk/1/servicedesk/request/ISSUEID/request-types

 You should also see a "portalKey" in the same record.  This is what I had to use!  It turns out my portal key was different than my project key (must have been rekeyed without my knowledge).

Martina Riedel
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.
August 19, 2020

@Kyle Keefer - interesting new piece, but I can't get 

/rest/servicedesk/1/servicedesk/request/ISSUEID/request-types

to return anything.

For ISSUEID I'm using the  id that /rest/api/2/issue/MYKEY-1 returns. I tried with several existing issues.

I'm on JSD 4.5.5 now. 

Is that what you are doing? Which JSD version?

Suggest an answer

Log in or Sign up to answer