Smartvalue empty after JQL branch

Julien FOURNIER May 11, 2021

Hi everybody,

 

I'm having trouble using smartvalue in an automation rule.

What I'm trying to do :

- I manually launch an automation from a request. This automation creates a new service Request with the same title.
- I search for a request with "JQL rule" and create a smartvalue containing a date from the request found (there can be only one in the system)

- I edit the created request with the date stored in the smart value.

 

Here is the automation :

image.png

The log is showing the date : 

image.png

 

Then, I edit the last created ticket and try to "paste" the value :

image.png

 

But the value is empty. When I log the value, it is also empty when I'm out of the JQL block.

 

How to keep the smartvalue available ?

 

Thanks a lot

 

 

 

1 answer

1 accepted

0 votes
Answer accepted
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.
May 11, 2021

Hi @Julien FOURNIER 

It appears you are creating the new issue (request) before a branch statement, and then creating a variable inside of the branch.  Then you want to use the created variable later.  Is this correct?  If so...

First thing, when you create an issue in an automation rule, the engine provides a convenient way to access its fields: {{createdIssue}}  When you have created multiple issues, you may access them as a list from {{createdIssues}} (please note the plural smart value) 

Using {{createdIssue}} may eliminate your need for the branch.

Finally, your branch uses JQL and could return multiple issues (theoretically).  And so the rule engine runs that separately from the rest of the rule (asynchronously).  The value of the Created Variable will rarely contain any value of use because of that.

There is a very specific case when a created variable can be used outside of a branch: when the branch evaluates to one-and-only-one issue.  Please look at this article if that matches your case to support using the saved variable:

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Create-variable-New-component/ba-p/1448118

Best regards,

Bill

Julien FOURNIER May 11, 2021

Hi @Bill Sheboy !

thanks for your time and reply.

I understand I misuse the automation !

As I can't use the branch JQL, I've used another strategy !

I copy the information when another rule is executed. Then, the information is available in the request from where the rule is launched.

 

Thanks a lot

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer