Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is there a way to concatenate or nest smart values?

I'm using Automation for Jira to automatically create a comment if the Approving Role for the current sub-task is "name of the role" but the value of the "name of the role" field within the parent of the sub-task does not equal the initiator of the workflow transition.

Instead of having to add if/else statements for every possible value {{issue.parent.name of the role.name}}, where "name of the role" is both the value of the sub-task's "Approving Role" field and the name of the custom field in the parent from which to grab a username for comparison to the initiator name, it would be great if the following were supported:

Condition:

{{initiator.name}}

does not equal

{{issue.parent.{{issue.Approving Role}}.name}}

4 answers

1 accepted

3 votes
Answer accepted

Thanks @John Funk 

@Michael Spoonauer - unfortunately other John is correct here. It isn't supported at the moment though we are tracking it here: https://codebarrel.atlassian.net/browse/AUT-1063

Makes a lot of sense. I have added a reminder at the end of the issue to post an update here once shipped.

Cheers,

John

Thanks for capturing this and for letting me know where to track it.

That would provide tremendous flexibility to the plugin, and get rid of a lot of if/else clauses.

Thanks again,
Mike

Nested if/else blocks feel different than being able to nest smart values.  But maybe I'm just missing it.  Also, can you allow members of the Atlassian community to watch codebarrel issues?

Thanks,
Mike

Hey Mike, 

Unfortunately there is no way of watching those issues for the moment. We are still trying to figure out the best way of bringing this over to the Atlassian systems. 

It might be worth putting through a support ticket with your request in case I am missing something. (I am on the marketing team rather than an engineer so they would have more experience around this). 

Cheers,

John 

0 votes
John Funk Community Leader May 11, 2020

Hi Michael - I am pretty sure the answer is No. But it might be something on their Feature Roadmap.

@John McKiernan  - any thoughts?

Bump - I have somewhat a similar usecase

 

I want to offset/postpone the Due Date by a numeric value from custom field in a automated rule/transition - Basically by replacing Due date with a current date+offset

 

But I cannot do so with:

{{now.plusDays({{issue.customfield_20530}})}}

 

I can only do static

{{now.plusDays(7)}}

 

I want the user to be able to have the input options for the offset

 

Right now I see no other solution than Scriptrunner/Groovy for something quite simple

 

Suggestions are welcomed

John Funk Community Leader Oct 16, 2020

Hi Morten - Welcome to the Atlassian Community!

Just a note up front - it is always better to create a new question than to post to an existing question. That way more people will see it. 

When you say: 

But I cannot do so with:

{{now.plusDays({{issue.customfield_20530}})}}

I think you have too many brackets. Try this:

{{now.plusDays(issue.customfield_20530)}}

Thx - Will do next time.

{{now.plusDays(issue.customfield_20530)}} does not work in Update field on Due Date - It just blanks the Due Date field - Have tested with static values ex. 30 as input in the smart value func - This works(So my automation works)

 

Would be nice to have dynamic input from another field on the issue.

John Funk Community Leader Oct 19, 2020

Can you post a screenshot of your actual rule with the code showing? 

Did you find a solution for this problem or is it just not possible yet? 

I have a similar issue.

Hi - I found that nested variables appear to work for numeric variables:

Projected growth is off by {{issue.Projected growth.minus(issue.Actual growth).abs}}

https://support.atlassian.com/jira-software-cloud/docs/smart-values-math-expressions/

I wonder if this could work for regular fields. Maybe if I put it in a function?

I wonder if the reason putting another variable inside parentheses doesn't work for @Morten Stensgaard 's issue is because it's a Date field, as opposed to Numeric.

It would be really awesome if this existing mechanism was extended to work for other field types.

Like John Funk likes this

There is another problem regarding to the original question, trying to use it on a property access:

({{issue.parent.{{issue.Approving Role}}.name}})

Rather than method call:

.minus(issue.Actual growth)

We will need either a way to force inline evaluation, or a getter method equivalent to direct property access...

Right, I realized later that it's not exactly the same case as the method calls.

Inline evaluation is exactly right.

Because even if we weren't using a property, but say we just set a Variable to be a JSON object, like so:

Set Variable {{alpha-approvers}}:
{
"A" : "abelincoln",
"B" : "barrywhite",
"C" : "captaincrunch",
...
"D" : "zoesaldana"
}

The problem remains that there's no way to reference that value, because this won't work:

Edit Issue, set Approvers:

{{alpha-approvers.{{issue.field1.value}} }}

Well, I finally got a request filed for this:

Possibility to nest smart values in Automation: 

https://codebarrel.atlassian.net/browse/AUT-2086

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Trello

📹 Favorite Trello templates

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. In this video, I'll share my favorite Trello templates. Templates mentioned in ...

75 views 4 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you