Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to use a conditional smart value

ben friedman June 13, 2021

Hi, 

i need to edit a value based on a smart value result.

i have an edit action where

{{#issue.issuelinks}}{{#if{{equals(type,"blocks")}} {{inwardissue.key}}{{/}}{{/}}

 

however, the condition isnt working!!

i tried it as simple as {{#if{{equals("2","2")}} x {{/}} and couldnt get to print x. 

where am i missing it?

2 answers

3 votes
Hauke Bruno Wollentin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 25, 2021

@ben friedman absolutely no idea why, but you need to add spaces in front of `if` and the closing `/`

{{ #if{{equals("2","2")}} x {{ /}}

A comment in the following article led me to this strange one: https://community.atlassian.com/t5/Automation-articles/New-automation-smart-values-in-Jira-Cloud/ba-p/1402775 

Bill Sheboy
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.
June 25, 2021

Hi @Hauke Bruno Wollentin  -- Welcome to the Atlassian Community!

Thanks for that reminder about the spacing, and... your link seems to have some extra chars making it fail.  Here's one that works:

https://community.atlassian.com/t5/Automation-articles/New-automation-smart-values-in-Jira-Cloud/ba-p/1402775

 

Best regards,
Bill

0 votes
Bill Sheboy
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.
June 14, 2021

Hi @ben friedman 

Based upon the way the JSON/smart values are structured for links, I am unclear how you can do that directly in conditional logic: the link type appears to be in a separate node above the list of linked issues.  You might be able to use string functions to put the entire string into a created variable and then use string functions with a regular expression to parse it.

Or...have you considered  using JQL with LookupIssues, and then test the count/process the remaining issues?  Something like:

issue IN linkedIssues({{issue.key}}, "blocks")

 

Best regards,

Bill

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events