The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Via an automation rule I have a field called Application. This is a custom Insight field.
For each selected value in this application field I need to set an Affected services (= default field with services from OpsGenie)
Unfortunately the affected services field does only support the set operation and not add meaning all values have to be provided at once.
This works:
{
"update": {
"Affected services" :
[{"set":
[{"id":"{{lookupObjects.first.Service.Service ID}}"}]
}]
}
}
This doesn't:
{
"update": {
"Affected services" :
[{"add":
[{"id":"{{lookupObjects.first.Service.Service ID}}"}]
}]
}
}
Does anyone have creative ideas to solve this?
Snippet of my rule:
Hi Charlie,
I had the same issue, please look at the next page. Loop-over list option in a combination with advanced branching worked for me.
Goodluck
Marius
Hi Marius,
Thanks for replying on this question. In the meantime I already found a solution but it is very similar to the post you linked.
I am looping over my list of values in the "edit issue task":
{
"update": {
"Affected services" :
[{"set":[
{{#lookupObjects}}
{"id":"{{Service.Service ID}}"}
{{^last}}, {{/}}
{{/}}
]
}]
}
}
I'll mark your answer as accepted to close this :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try changing your second JSON snippet so the value of "add" is an object? At the moment, the value of "add" is an array.
I'm just trying to follow the example outlined in https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/.
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric,
Thanks for your suggestion.
I actually got an error along the lines of: add operation is not supported.
I also double checked using the /editmeta endpoint and here is the result:
https://<xxx>.atlassian.net/rest/api/3/issue/TSD-530/editmeta
"customfield_10036": {
"required": false,
"schema": {
"type": "array",
"items": "service-entity-field",
"custom": "com.atlassian.jira.plugins.service-entity:service-entity-field-cftype",
"customId": 10036
},
"name": "Affected services",
"key": "customfield_10036",
"autoCompleteUrl": "https://<xxx>.atlassian.net/rest/service-registry-api/service?query=",
"operations": [
"set"
]
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.