Hi Guys!
Hope anyone can help a n00b out :) kinda new to Jira and got a bit stuck.
This is the statement am trying to get to work.
{{#if(equals(issue.customfield_10193, "On Site"))}}On distance{{^}}On Site{{/if}}
So what am trying to do is to check whats the value of field issue.customfield_10193, if its one it should return the other. if its ether it should return "On Site".
This one is created inside an automation where am setting a variable. and then use the variable to set the topic of later created task. its on the task of setting the topic am getting the error. but all am doing there is added the {{Utforas}}.
SB - {{issue.customfield_10073}} - {{Site}} - Q1 - {{Utforas}}
so am pritty sure its the issue with the if-statement where the wrong is. ? ! ? :)
Thanks
From what I understand, you want to check the value of issue.customfield_10193, and if it's "On Site", return "On distance" — otherwise, return "On Site".
To achieve this using the equals function in an if condition, you can use the following smart value:
{{#if(equals(issue.customfield_10193.value, "On Site"))}}On distance{{/}}{{#if(not(equals(issue.customfield_10193.value, "On Site")))}}On Site{{/}}
If the answer helps, please accept the answer.
Best regards,
Murat Seven
Oh, nice @Murat Seven you added .value to the custom field. I missed that.
However I haven't seen {{/if}} to close an {{#if}}. Is that documented anywhere? Maybe it just works because Automation ignores everything after the / in {{}} braces?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had used {{/}} during testing, but I made a mistake when writing it here.
You're right — I should have written {{/if}} as {{/}}.
I've corrected it now, thank you @Darryl Lee :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Gents, :)
I have tested the:
{{#if(equals(issue.customfield_10193.value, "På plats"))}}På distans{{/}}{{#if(not(equals(issue.customfield_10193.value, "På plats")))}}På plats{{/}}
And am not getting any errors atleased when saving :D thats a huge step !
(its translated to Swedish now instead of english.. just so you know. but its still the same :) On Site and On Distance.)
Thank you ! will test some more <3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @mikael_stiglen!
Unfortunately Smart Values conditional logic does not support else, so what you probably need to do is have two IFs in a row, like so:
{{#if(equals(issue.customfield_10193.value, "On Site"))}}On distance{{/}}{{#if(not(equals(issue.customfield_10193.value, "On Site")))}}On Site{{/}}
That's all on one line, for readability, here it is:
{{#if(equals(issue.customfield_10193.value, "On Site"))}}On distance{{/}}{{#if(not(equals(issue.customfield_10193.value, "On Site")))}}On Site{{/}}
Although for clarity and simplicity, you might want to do this with an IF/ELSE block:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Darryl Lee for the reply.. :-)
My problem is that i already have an IF statement after my creation of the variable. and am having technical dificulties to make several if`s in the same automation.. but thats problebly my own limit of knowlage that stops that :/ or is that possible to add another if statement before then ? :-O
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hum, my Swedish is a little rusty (hehe), but I'm thinking that a possible problem with multiple IFs (as well as using {{#if}} within Smart variable creation) is that Automation actions execute in parallel (asynchronously). (AUTO-32)
Which means that it's possible {{Site}} is not yet defined by the time you try the Edit action to update Summary to:
SB - {{issue.customfield_10073}} - {{Site}} - Q1 - {{Utforas}}
(Also, you'll probably want to use {{issue.customfield_10073.value}} there.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.