Pulling a custom variable into an email

We have two JIRA plugins that we are using:

 

  • Codebarrel automation
  • ProjectBalm Risk Register

 

I have an automation rule set up to email our teams when a risk get assigned to their team. One of the fields I would like to put in the notification email is the exposure (Low, Medium, High, Critical). 

Below is an example of how the body of our email is structured:

******

Risk {{issue.key}} has been assigned to your team

Risk Rating: <need help here>

To view this risk:
https://jira.hy-vee.com/browse/{{issue.key}}

Current Assignee: {{issue.assignee}}

Risk Description:
{{issue.fields.description}}

********

 

I am having a tough time figuring out the variable needed to display the risk rating. I have so far attempted the below:

*******

1: {{issue.keys}}

2: {{issue.keys.customfield_11343-val}}

3: {{issue.keys.customfield_11343}}

4: {{customfield_11343-val}}

5: {{issue.fields.exposure-cf-type}}

5: {{issue.fields.customfield_11343-val.exposure-cf-type}}

7: {{issue.fields.customfield_11343-val}}

6: {{customfield_11343-val.exposure-cf-type}}

8: {{issue.fields.customfield_11343}}

9: {{issue.fields.customfield_11343.name}}

10: {{issue.fields.customfield_11343.value}}

11: {{issue.fields.customfield_11343.val}}

12: {{issue.fields.customfield_11343_name}}

********

 

The only one that has returned anything is #8 - which has returned the below:

******

Exposure{id=1, name='Low', description='null', severity=0, bgColor=java.awt.Color[r=20,g=137,b=44], fgColor=java.awt.Color[r=255,g=255,b=255]}

******

 

What I would like to extract out of that variable, is the word "Low", or if it were different, then that word. 

 

Any help is appreciated! 

 

For reference, below is the information about our environment:

JIRA Version: 7.4.2

Risk Register Version: 3.10.2

 

2 answers

0 vote
Scott Harwood Community Champion Dec 20, 2017

Hi,

What you are after is below

{{issue.fields.customfield_11343.name}}

 For ready ability sake, you also don't need use the custom field id. You can simple use the name of the field (e.g exposure).

{{issue.exposure.name}} 

For future reference a good way to debug the output is to use a log action, will save you from sending a bunch of emails to test everything. More about that here.

Cheers,

Scott

I had tried the top one already but it didnt display anything for me. The second one you suggested I just attempted but it also didnt appear to give me anything back. 

 

How can I use a log action in this situation?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Apr 10, 2018 in Marketplace Apps

Learn about how Stefan K. built one of the *first ever* Marketplace apps

In this post you will discover more about the evolution of K15t software, some big topics they're currently focusing on in the app space, and a rare (not not funny!) photo of founders Mike Cannon-Bro...

12,587 views 11 24
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you