Hello,
I am trying to migrate from Opsgenie to JSM/Operations for alert management, and I am encountering a problem.
I have set up the integration, and I am able to automatically create alerts when a customer creates a ticket in JSM.
During alert creation, I would like to access the content of the JSM "work item" to retrieve information stored in custom fields.
To do this, I am using the following syntax:
{{_payload.customFields.customfield_00000}}This works correctly in most cases.
I have a problem with a Select List (single choice) custom field, from which I am trying to retrieve the value.
The JSON looks like this:
_customfield_00000:
self:
https://xxx.atlassian.net/rest/api/2/customFieldOption/11111
id:
11111
value:
AAA
The syntax:
{{_payload.customFields.customfield_00000.id}}returns
11111
But the syntax
{{_payload.customFields.customfield_00000.value}}does not return “AAA” as I would like, but
“{”self“:”https://xxx.atlassian.net/rest/api/2/customFieldOption/11111“,”value“:”AAA“,”id“:‘11111’}”
Do you have any idea what I'm doing wrong?
Thank you very much for your help.
You first need to get the id of the custom field where you want to get the information from.
See this KB to find the id of the required custom field.
https://confluence.atlassian.com/jirakb/how-to-find-id-for-custom-field-s-744522503.html
The option with 00000 you found is an example.
Yes, thank you @Marc -Devoteam- .
Sorry, I wasn't clear enough. I did get the id of the custom field. I replaced it with 00000 just for my question here.
I'm sure I have the right custom field ID, but I can't seem to simply catch its value.
Thank you for your response !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check this page; work-with-dynamic-properties
This should be the way to add values from custom fields in the alert.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Marc -Devoteam- , thank you for your answer.
I used this page to understand the necessary syntax, and it was usefull because I'm now able to retrive the ID of a "Select List (single choice)" customfield option, but despite this, I am unable to simply retrieve the value itself.
In my exemple, ID of the customfield is 00000, ID of the customfield's option is 11111, but I would like to get the label of customfield's option (which is "AAA")
Maybe the syntax
{{_payload.customFields.customfield_00000.value}}is not correct, but I still don't understand why.
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.