Hello,
I am working on integration LogicMonitor with JIRA and have successfully integrated it. I could see JIRA tickets populating but I want to add a "labels" field as well into my JIRA ticket. When I tried adding that into my payload I see syntax error. Can anyone help with this?
Below is my current payload on logicMonitor:
{
"fields": {
"project": {
"key": "FOUN"
},
"summary": "LM - ##DATASOURCE## ##ALERTTYPE## ##LEVEL## alert ##HOSTNAME##",
"description": "##MESSAGE##",
"issuetype": {
"name": "Task"
},
"labels": [ "MOD"
],
"components": [{
"name": "Network"
}]
}
}
and this is the error message I see
{"errorMessages":["Unexpected character ('\"' (code 34)): was expecting comma to separate OBJECT entries\n at [Source: org.apache.catalina.connector.CoyoteInputStream@76f45564; line: 1, column: 385]"]}
Hello @Minori Telang ,
If I understand correctly everything works fine if you create the Jira issue via REST API without labels, the error is only returned when you add the labels section to the JSON body of the REST API request.
Now, if this is correct, it can be the case that the labels field is not present in the create issue screen for the project FOUN and issuetype Task, as explained in below thread:
If this is not the case instead, please provide more details. For example:
curl -u <EMAIL-ADDRESS>:<API-TOKEN> -D- -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{"fields":{"projects":{"key":"FOUN"},"summary":"test create issue", "description":"SOME DESCRIPTION", issueType":{"name":"Task","subtask":false},"priority":{"name":"Medium"}, "labels":["MOD"],"components":[{"name": "Network"}]}}' -X POST "http://<NAME>.atlassian.net/rest/api/3/issue"
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.