Uploaded image for project: 'Automation for Jira Server'
  1. Automation for Jira Server
  2. JIRAAUTOSERVER-1047

"Create variable"- Create Type Variable action to preserve the source data typing

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • Fields
    • 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.

      Issue Summary

      Create a Typed Variable action to preserve the source data typing

      Steps to Reproduce

      "Create variable" does not recognize dates, converting them to String/text format in the automation rule

      This is reproducible on the Data Center: Yes

      1. Create an automation rule with trigger "Manual trigger"
      2. Add an action to "Create variable" and name it "example" and add smart value
        {{now}}
      3. Add another action to the rule to "log action" and try printing the variable that you just created using
        {{example.jiraDateTime}} 
      4. Check the audit log of the rule and nothing gets logged in the audit log
      5. Edit the "log action" with
        {{Example.toDate.jiraDateTime}}

      Expected Results

      audit log should print the current date as the "create variable" should consider now smart value as the date field and print the date accordingly

      Actual Results

      nothing gets printed in the audit log and it is empty

      This known behaviour as mentioned in our documentation for Jira automation actions

      Create variable

      Use smart values here: Yes

      Define your own smart value, that can be used in other actions and conditions in the same rule. This smart value can consist of other smart values as well as math functions.
      This action always returns a string. For example, if you create a variable that’s called Stakeholders and has the smart value {}{{issue.watchers{}}}, your variable will return the list of watchers but the list would be rendered as a string.

      To use the variable in the automation rule after it is created, use the syntax {}{{variable_name{}}}. In the provided example, the syntax will be {}{{Stakeholders{}}}.

      Workaround

      1. edit the "log action" with
        {{Example.toDate.jiraDateTime}}

      For more information please go through Jira smart values - date and time

              Unassigned Unassigned
              dgedda@atlassian.com Devisree Gedda
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: