Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,759
Community Members
 
Community Events
165
Community Groups

Opsgenie: extra properties filtering

Hello everyone in this community!

 

I need help to create Perfect view of created Opsgenie alert :)

Let me show details.

I have custom multi-select field Post-Incident Review Actions  with 2 options:

  • Investigation of financial losses
  • Security team analysis

ScreenShot 2022-06-05 at 22.19.35@2x.jpg

When I "ask" JSON payload

ScreenShot 2022-06-05 at 22.21.10@2x.jpg

of Opsgenie+Jira Management integration for this CustomField data with {{ customFields.customfield_10189.value }}

ScreenShot 2022-06-05 at 22.20.17@2x.jpg

I get this not beautiful, but quite informative output in created Opsgenie alert:

ScreenShot 2022-06-05 at 22.19.58@2x.jpg

Can I filter this output to create clear and informative Opsgenie alert? I need to receive in Opsgenie created alert data from Value JSON payload.  


For clarification: this output is enough for next steps (assign, route and so on) in Opsgenie.

I want to understand the filtering mechanism (if it can be used in this case).


Will be very glad for any kind of help.

1 answer

1 accepted

0 votes
Answer accepted
Nick H Atlassian Team Jun 06, 2022

Hi @Roman Pankovski ,

Similar to what you are using in the field, Service for Review, you will most likely want to use some form or string processing or regex to clean up the data being extracted.

Maybe something like:

{{ customFields.customfield_10189.substringBetween("value=",",")}}

 

But are you trying to pull both of these values?

cf1.jpg

 

If yes, then the string processing method above would only work on the first match, and it appears there might be two values parsing in this custom field.

 

In that case, string processing should still work, but might need to be a bit more specific for each value. Maybe something like these two - but all depending how they parse in the payload as well:

{{ customFields.customfield_10189.substringBetween("10264,value=",",")}}

{{ customFields.customfield_10189.substringBetween("10265,value=",",")}}
Nick H Atlassian Team Jun 06, 2022

These also might work as well:

{{customFields.customfield_10189.substringBefore("id").substringBetween("value=",",")}}

{{customFields.customfield_10189.substringAfter("id").substringBetween("value=",",")}}
Like Roman Pankovski likes this

Hi, @Nick H! Thnx for answering!

I applied your suggestions in my workflow and can show what I receive.

1.

{{ customFields.customfield_10189.substringBetween("10264,value=",",")}}

{{ customFields.customfield_10189.substringBetween("10265,value=",",")}}

 Output: null null

2. 

{{customFields.customfield_10189.substringBefore("id").substringBetween("value=",",")}}

Output: Investigation of financial losses (this is the first value)

{{customFields.customfield_10189.substringAfter("id").substringBetween("value=",",")}}

Output: Security team analysis (this is the second value)


Conclusion: 2-nd option is working!

But, in my opinion, this is specific solution acceptable for not more than 2 options - we take only BeforeAfter values of payload.

 


I move a little bit forward and modify your suggestions like this:

{{customFields.customfield_10189.substringAfter("10264").substringBetween("value=",",")}}, 

{{customFields.customfield_10189.substringAfter("10265").substringBetween("value=",",")}}

Output: Investigation of financial losses, Security team analysis (both values here!)

But there is another annoying thing - if Reporter choose only one option (example: Investigation of financial losses) here is what I receive in output:

Investigation of financial losses, null

 

Questions:
1. is there any way to filter "null" from output?
2. is there any way to make multiline output?

Example of multiline output: 
Investigation of financial losses
Security team analysis

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

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 ...

308 views 0 9
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you