How can I use text smart values in math expressions?

Gary Olmsted September 30, 2020

I am trying to use smart values to insert text into the Send Slack message automation.  I can insert text values easily like this:

*{{issue.issueType.name}} (Sev {{issue.severity}})* <{{issue.url}}|{{issue.key}} - {{issue.summary.remove("\n")}}> reported by *{{reporter.displayName}} (<mailto:{{reporter}}|{{reporter}}>)*

What I want to do, is given a certain Issue severity level or issue type, insert an icon in the message.  If I use issue.severity, I get something between 1 - 5.  If I use issue.issueType, I get the numerical id of the type.  I thought that by doing something like this...

{{#if(issue.severity.eq(1))}}:siren:{{/}}

...or...

{{#if(issue.issueType.id.eq(12300))}}:siren:{{/}}

...it doesn't print anything.  I have also tried:

{{#if(issue.severity.asNumber.eq(1))}}:siren:{{/}}

...but nothing either.  Any ideas how I can use these issue fields for doing this type of function?

1 answer

0 votes
Sergey vc March 15, 2021

I tried this {{#if(issue.issueType.id.eq(10912))}}:siren:{{/}}

It worked for me!image.png

Suggest an answer

Log in or Sign up to answer