Forums

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

LogicMonitor: Correct payload to populate labels in JIRA ticket ?

Minori Telang October 19, 2020

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]"]}

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2020

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:

  1. Let us know if project FOUN is classic or next-gen
  2. Reproduce the issue using curl, adding the -D- switch and paste the output in your reply (replace <EMAIL-ADDRESS>, <API-TOKEN> and <NAME> with the correct values):
    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

Suggest an answer

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

Atlassian Community Events