Forums

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

Attempting to create JSM Request from API

thorngje
Contributor
July 7, 2022

API: https://my.atlassian.net/rest/servicedeskapi/request

Body:

"serviceDeskId""12",
    "requestTypeId""292",
     "requestFieldValues": {
        "customfield_10283": [
                {
                    "objectId""68576"
                }
            ],
        "customfield_10290""Last Name"
     }
 }
Error 400: 
{
    "errorMessage""Unable to create request because of theses errors : The field 'customfield_10290' is not valid for this request type 'Request new user'.",
    "i18nErrorMessage": {
        "i18nKey""sd.request.create.error.failed.msg",
        "parameters": [
            "The field 'customfield_10290' is not valid for this request type 'Request new user'."
        ]
    }
}
This field is on the issue type create screen.  Anything else why it would not let me set the custom field with API?

1 answer

1 accepted

2 votes
Answer accepted
Joseph Chung Yin
Community Champion
July 7, 2022

@thorngje -

Can you confirm that your JSM request form is associated with the specific issue type?  In addition, please validate the custom field context configuration to ensure the field is indeed configured for your JSM project/issue type in question.

If both checked out ok, please also ensure the field is also added to the issue screen for EDIT operation.

Hope this helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

thorngje
Contributor
July 8, 2022

Screenshot 2022-07-08 102626.jpgScreenshot 2022-07-08 102417.jpgScreenshot 2022-07-08 102316.jpg

thorngje
Contributor
July 8, 2022

That is what I have set.  Is it because they are fields on a form?  Is this a limitation to API.  I have the fields link to Jira fields but when I do a GET t/rest/servicedeskapi/request/AI-xxx

I do NOT see the fields in the response.

Joseph Chung Yin
Community Champion
July 8, 2022

@thorngje -

Currently, there is an limitation where if you need to retrieve fields (only in the Form configuration), you will need to use the Form (Proforma REST API) to obtain the data.  It is not yet been incorporated into Jira/JSM REST API library yet.

If you already linked your Form's field properly to Jira/JSM fields, then you should be able to obtain the data by using just the Jira/JSM REST API calls.  In addition, if you look at the issue view UI via the project against the request issue, you should also see the Jira/JSM field that was populated from your Form's intake assuming you did exposed the field to the issue view screen.

Best, Joseph

thorngje
Contributor
July 11, 2022

I just happened to stumble across the answer to my problem.  I had the fields linked on the form.  Then I found out  was I had to add them to the Request form as well to fix my issue. Screenshot 2022-07-11 102301.jpg

Screenshot 2022-07-11 102511.jpg

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events