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.
Atlassian Support answered and gave me a solution.
This syntax works fine : {{_payload.customFields.customfield_XXXXX.value.value}}
Thank you again @Marc -Devoteam- 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
What is the result if you try, {{_payload.customFields.customfield_00000}} or {{customFields.customfield_XXXXXX}}
Or are you using an incoming webhook, then try {{_payload.customField}} or {{_payload.issue.fields.customfield_XXXXXX}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Marc -Devoteam-
I'm using native "Sync" integration
If I try {{_payload.customFields.customfield_00000}}, I get :
{"self":"https://xxx.atlassian.net/rest/api/2/customFieldOption/10866","value":"S3","id":"10866"}If I try {{_customFields.customfield_00000}}, I get the exact same :
{"self":"https://xxx.atlassian.net/rest/api/2/customFieldOption/10866","value":"S3","id":"10866"}And I get the exact same again if I try
{{_customFields.customfield_00000.value}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What if you try _payload.issue.fields.<name of the custom field>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Neither of the two tests returns anything :
_payload.issue.fields.<name of the custom field>
and
_payload.issue.fields.<name of the custom field>.value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you replace <name of the custom field> with the name of your field?
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.
I think then it's best to reach out to Atlassian Support and see how they might help.
(You will need to hold n admin role to raise a request, minmal is Jira admin)
Please list the solution if they provide one
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.