Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Jira automation variable value set to empty

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

 

2 answers

1 accepted

1 vote
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")}}
0 votes
nmenere Atlassian Team 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

@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.

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 Jira Service Management

JSM Jira Automation: How to Send SLA Breached Notifications

Hi Everyone, In   this tutorial,  we will show you how you can monitor an SLA, and send notifications before or after the SLA has been breached.   SLA Threshold Trigger The SLA t...

722 views 5 13
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