Hi everyone,
I'm having troubles to assign value to "Labels" field in Jira using Google App Script as part of Google Form/Sheet integration to create Jira Issue.
In other words, the app script runs when google form is filled in. It creates jira ticket and I'd like one of the form's fields to be written to the "label" field in Jira.
extract of the code:
var IssueData = {"fields":
{"project": { "key": JiraProject },
"summary": JiraTitle,
"issuetype": {"name": "Task"},
"description": LongDescription,
"labels" : {"value" : LabelName}
}
};
Hello @Iryna Levchenko ,
For the Create issue API via the endpoint POST /rest/api/2/issue the formatting for the labels should be like this:
"labels": [ "label 1", "label 2" ]
And there is a full working example in the API documentation at the link POST /rest/api/2/issue.
But one caveat that gets a lot of people when adding labels on a create issue API that might be causing an issue for you is that if the labels field is missing from the create issue screen on the project you would receive a 400 bad request error attempting to place a value in the missing field, and "labels" field is not on the create issue screen by default. So double-check and verify the field is present.
Also just as a reference point in case anyone else runs into this thread looking for a similar solution with questions about the Google Sheets external API integrations, the documentation for this can be found here:
Regards,
Earl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.