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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,639,539
Community Members
 
Community Events
196
Community Groups

Jira automation variable value set to empty

Peter Reiser
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.
Mar 12, 2021

How can I set a Jira automation variable to empty ? 

When adding a variable I have to provide a value.

The current workaround is to set the value of the variable from an empty custom field.

Screenshot 2021-03-12 at 22.58.48.png

 

-- but this is not a really professional solution :-)

 

Thanks your your feedback

Peter

 

3 answers

1 accepted

2 votes
Answer accepted

One workaround:

  1. Create the variable with a value that is an arbitrary known string:
    • Variable name:  myCoolVariable
    • Smart value:  _EMPTY
  2. Set ("create") the same variable again with a value that is itself with the "remove" function called on the same arbitrary known string:
    • Variable name:  myCoolVariable
    • Smart value:  {{myCoolVariable.remove("_EMPTY")}}

You can just use {{remove}} to empty a field.

0 votes
nmenere
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 16, 2021

Hey Peter,

I'd love to hear the use-case for this as I can't really think of one.

 

Cheers,
Nick Menere
Automation Group Product Manager

Peter Reiser
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.
Mar 17, 2021

@nmenere  Here is our use case

1 .We have a 1st level Servicedesk per country ( 10+ Servicedesks)

2. Each Country Servicedesk has different values for the Technical/Application categorisation as they have different services/applications

3. We have automated ticket routing for 2nd level support Servicedesk's based on cascading fields (Technical/Application categorisation) from the 1st Level Servicedesk.

We are using Automation rules to evaluate the Technical/Application values and then set to correct Technical/Application categorisation for the 2nd level Servicedesks. In certain case we have to set the cascading field to empty

Example:

{ 
"fields": {
"customfield_10052" : { "value": "Services", "child": { "value" : "{{TechnicalCategory}}"} },
"customfield_10051" : { "value": "{{ApplicationCategory}}", "child": { "value" : "{{ApplicationCategoryChild}}"}}
}
}

Where variable {{ApplicationCategoryChild}} has to be empty

I have a scenario where I need to check if any of a set of possible changes occurred during an Issue Updated event.

I need to create a variable defaulted to empty / null.  Then with a sequence of if-elseif-elseif, if any branch is true it sets the variable to a non-empty value (like "true").  Then the rule is allowed to proceed only if the variable is not empty.  (I need to use if-elseif because Automation does not provide logical "OR".)

Workaround:  Check the variable for exactly "true" (or not "false").  but "code" not as "clean".

Scenario: we have a transition screen where you can check boxes like "Create Epic for this work"

Within the automation rules we create various issues and based on if an epic is created, set that as the epic link.

Since we can't do an if within an if, I can't check if the epic is created and should be linked so I have created that as a global variable and setting that variable within the block of the epic creation.

I do an issue lookup to sum up the values of a field.
I store that sum up in another variable.

I do another issue lookup to target a specific issue to deposit the result. I attempt to edit the target of the issue lookup, but Jira ends up editing one of the issues from the FIRST {{lookupIssues}}. Seems like subsequent Issue lookups ADD to the existing {{lookupIssues}} instead of replacing them. 

I'd prefer to null the field out before doing another issue lookup.

Scratch this, it was underdocumented behavior of the "Edit Issue" automation.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events