Hello,
I am working on Logicmonitor+JIRA integration. I want to add labels to my JIRA ticket and I am using REST API in the JSON format to accomplish this. Currently below is what is configured for labels.
"labels": [
{"add":"LogicMonitor"},{"remove":"REACTIVE"}
],
But I see following errors, can someone please help:
{"errorMessages":[],"errors":{"labels":"string expected at index 0"}}
Try this syntax!
{ "update": { "labels": [ {"remove": "newlabel"}, {"add": "Test-label"}] } }
I got that from here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kian Stack Mumo Systems Below is the error:
{"errorMessages":["Unexpected character ('{' (code 123)): was expecting double-quote to start field name\n at [Source: org.apache.catalina.connector.CoyoteInputStream@695d2976; line: 1, column: 344]"]}
Below is how I configured:
{
"fields": {
"project": {
"key": "FOUNENG"
},
"summary": "LM - ##DATASOURCE## ##ALERTTYPE## ##LEVEL## alert ##HOSTNAME##",
"description": "##MESSAGE##",
"issuetype": {
"name": "Task"
},
{ "update": { "labels": [ {"remove": "REACTIVE"}, {"add": "LogicMonitor"}] } },
"components": [
{
"name": "Network"
}
]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kian Stack Mumo Systems I am trying to create a ticket. LogicMonitor is a network monitoring tool, so after the Logicmonitor + JIRA integration whenever there is an alert generated on Logicmonitor it will trigger JIRA to create a new ticket. All this is working fine except the label part. As you can see above "FOUNDENG" is our project name. On JIRA we have setup a rule, if someone opens a ticket with FOUNENG that ticket should populated with label " REACTIVE". As I have recently integrated JIRA+LM, I have added a new rule to the FOUNENG project to add " LogicMonitor" as well when somone opens a ticket. Now, the problem is that I see 2 duplicate tickets getting generated one with the label " LogicMonitor" other one with "REACTIVE". That is the reason, I want to remove this "REACTIVE" from the REST API, so the only one ticket populates and with the label " LogicMonitor".Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Minori,
I'll take a look at the JSON for you, but where is the second ticket coming from? Your Rest API should only be creating a single ticket, but you make it sound like it is creating two.
Thanks,
Kian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, you can't "remove" when you are creating it. That doesn't make sense. If anything, your automation rule would need to filter out these specific tickets.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So here is the JSON which will create an issue for you with the label of LogicMonitor
{
"fields": {
"project": {
"key": "FOUNENG"
},
"summary": "LM - ##DATASOURCE## ##ALERTTYPE## ##LEVEL## alert ##HOSTNAME##",
"description": "##MESSAGE##",
"issuetype": {
"name": "Task"
},
"labels": ["LogicMonitor"],
"components": [
{
"name": "Network"
}
]
}
}
To address the other issues will require working on your automation rule.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kian Stack Mumo Systems Thanks! I already had that JSON configured and was able to see the label logicmonitor but alone with that I could see REACTIVE as well. I thought adding "remove:REACTIVE" might remove that label when Logicmonitor sends a request to JIRA. But, thanks again, this clarifies that it is not the issue with the JSON but the automation rule on JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kian Stack Mumo Systems - Can you please give a brief idea on what changes needs to be done on the JIRA side ? What kind of automation rules need to be set up ? Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Minori, I don't know what automation rules you have set up, so I can't speak to what kind of changes need to be made.
Typically, when creating automated tickets via REST API (which you are doing) you would use some sort of service account. What I would look to do is set a condition on the automation rule which is setting the label for new tickets to exclude the user account you are leveraging to create those tickets via Json.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.