Uploaded image for project: 'Automation for Cloud'
  1. Automation for Cloud
  2. AUTO-19

Ability to define a global variable or lookup table that can be used in automation

    • 0
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Define a feature, where we can create a global variable that can be used within automation rules. This way, we can be able to call this variable into multiple rules and easily change it as well.

            [AUTO-19] Ability to define a global variable or lookup table that can be used in automation

            Global Variable are required not only for Automation but we need to use the variables within the JQL. That is the most important use case. 

            Pankaj Chamria added a comment - Global Variable are required not only for Automation but we need to use the variables within the JQL. That is the most important use case. 

            This is absolutely needed. 

            Sai Nikhil Guntur added a comment - This is absolutely needed. 

            Phumi added a comment -

            Phumi added a comment - https://getsupport.atlassian.com/browse/PCS-274703

            Yes, I think we are saying the same thing...except for branching behaviors.

            Bill Sheboy added a comment - Yes, I think we are saying the same thing...except for branching behaviors.

            Hey f45ff7f23a3f

            Thanks for the comment and answer!

            Hi Slava Gefen,

            I respectfully suggest you re-test to confirm your rules and variables work as expected.

            What I meant above is if you don't create a variable before IF-ELSE it won't work later. But if you do, it will.

            The steps to reproduce:
            1. Create a manual triggered rule.
            2. Create a variable called Var and set it to "Empty".
            3. Create IF-ELSE condition with the advanced compare condition 1 equals 1.
            4. In IF set Var to "Yes".
            5. In ELSE set Var to "No".
            6. Log Var.

            You'll get "Yes".

            Then delete item 2 above and you'll get "" as a result of Var.

            With branching I've tested only with one issue yet, it's true.

            Slava Gefen added a comment - Hey f45ff7f23a3f Thanks for the comment and answer! Hi Slava Gefen, I respectfully suggest you re-test to confirm your rules and variables work as expected. What I meant above is if you don't create a variable before IF-ELSE it won't work later. But if you do, it will. The steps to reproduce: 1. Create a manual triggered rule. 2. Create a variable called Var and set it to "Empty". 3. Create IF-ELSE condition with the advanced compare condition 1 equals 1. 4. In IF set Var to "Yes". 5. In ELSE set Var to "No". 6. Log Var. You'll get "Yes". Then delete item 2 above and you'll get "" as a result of Var. With branching I've tested only with one issue yet, it's true.

            Hi Slava Gefen,

            I respectfully suggest you re-test to confirm your rules and variables work as expected.

            For things in rules which occur sequentially, created variables can in fact replace the values of earlier, created variables with the same name.  For example,

            • create a variable before an IF condition,
            • re-create the variable (i.e., with the same name) inside of the IF condition, and
            • then display/use the results later to see the change. 

            The same thing applies for branches which are on one-and-only-one issue (e.g., branch on parent, last created issue, etc.).  This behavior was described in an article by Atlassian staff here: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Create-variable-New-component/ba-p/1448118  Essentially the variable is replaced, not edited.

            However for branches which could be on more than one thing (e.g., JQL, subtasks, etc.), the processing occurs asynchronously and non-deterministically.  There is no guarantee that the branch will complete until up to the last point in the rule.  What this means is that when a variable is re-created (i.e., with the same name) within such a branch, it is a new variable each time, created in another process.  Any possibility of it replacing (or shadowing) a variable created before is unlikely, and more likely a coincidence.  To learn more about branch processing order, please look here: https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/#Ordering-of-branch-executions

            There is a suggestion to make the concurrency processing of rules configurable, which you may follow here: https://jira.atlassian.com/browse/AUTO-32 and another suggestion to allow edit of created variables, which you may follow here: https://jira.atlassian.com/browse/AUTO-26

            Kind regards,
            Bill

            Bill Sheboy added a comment - Hi Slava Gefen, I respectfully suggest you re-test to confirm your rules and variables work as expected. For things in rules which occur sequentially, created variables can in fact replace the values of earlier, created variables with the same name.  For example, create a variable before an IF condition, re-create the variable (i.e., with the same name) inside of the IF condition, and then display/use the results later to see the change.  The same thing applies for branches which are on one-and-only-one issue (e.g., branch on parent, last created issue, etc.).  This behavior was described in an article by Atlassian staff here: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Create-variable-New-component/ba-p/1448118   Essentially the variable is replaced, not edited. However for branches which could be on more than one thing (e.g., JQL, subtasks, etc.), the processing occurs asynchronously and non-deterministically.  There is no guarantee that the branch will complete until up to the last point in the rule.  What this means is that when a variable is re-created (i.e., with the same name) within such a branch, it is a new variable each time, created in another process.  Any possibility of it replacing (or shadowing) a variable created before is unlikely, and more likely a coincidence.  To learn more about branch processing order, please look here: https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/#Ordering-of-branch-executions There is a suggestion to make the concurrency processing of rules configurable, which you may follow here: https://jira.atlassian.com/browse/AUTO-32 and another suggestion to allow edit of created variables, which you may follow here: https://jira.atlassian.com/browse/AUTO-26 Kind regards, Bill

            Hi All, we've just found out this nice behavior:
            If you use a Variable inside IF-ELSE condition, it doesn't work further outside.

            But if you declare this variable before IF-ELSE and then use it inside then it works outside of the condition 😃

            Maybe it might be useful for someone.

            And also we've checked, variables work out of a branch rule. I'm not sure all, but in my case I got a summary of linked issue, and then could print it out of the branch.

            With kind regards
            Slava

            Slava Gefen added a comment - Hi All, we've just found out this nice behavior: If you use a Variable inside IF-ELSE condition, it doesn't work further outside. But if you declare this variable before IF-ELSE and then use it inside then it works outside of the condition 😃 Maybe it might be useful for someone. And also we've checked, variables work out of a branch rule. I'm not sure all, but in my case I got a summary of linked issue, and then could print it out of the branch. With kind regards Slava

            xKostyan added a comment -

            it's 2023, no global variables

            xKostyan added a comment - it's 2023, no global variables

            Hi @charlie - good to have you assigned. Please help these automation guru's out. I know it's another feature - but keep in mind that global variables in relation to global connections with external API's. 

            Remko Nankoe added a comment - Hi @charlie - good to have you assigned. Please help these automation guru's out. I know it's another feature - but keep in mind that global variables in relation to global connections with external API's. 

            This is a must have. E.g. Now I'm using a lot of REST calls which - of course - need usernames, passwords, keys etc. In my case I have to renew my passwords every 3 months...................

            Remko Nankoe added a comment - This is a must have. E.g. Now I'm using a lot of REST calls which - of course - need usernames, passwords, keys etc. In my case I have to renew my passwords every 3 months...................

              89403358cf11 Charlie Gavey
              hnyeche Prince N
              Votes:
              129 Vote for this issue
              Watchers:
              64 Start watching this issue

                Created:
                Updated: