Pulling a custom variable into an email

mengler December 20, 2017

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 votes
mengler December 21, 2017

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?

0 votes
Scott Harwood
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events