Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,456,338
Community Members
 
Community Events
176
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

Atlassian Community Events