Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I need Jira automation to apply a date based upon the initiator's time zone.

Shane Cross February 14, 2023

I have set up a simple automation that will automatically enter the Completed Date field of an issue when it is transitioned to Done.  I initially accomplishied this by using the {{now}} argument for the field.

This brought up some issues, as the Automation for Jira user was in a different time zone (Europe/London) than our developers (United States/New York), so issues that were transitioned past 7 PM were showing the next day for their Completed Date.  

I fixed that by using {{now.convertToTimeZone("America/New_York")}}.  Now, the date for the Completed Date field is updating as is the user initiating the transition to Done is in New York.  This works fine for now, but we're going to be bringing on some offshore resources.

Ideally, I'd like the automation rule to set the date according to the initiator's time zone, instead of the America/New York time zone.

I thought I'd be able to accomplish this by using one of the following:{{now.convertToTimeZone(initiator.timeZone)}}

{{now.convertToTimeZone(issue.initiator.timeZone)}}

Neither are producing the expected results.  Doing so actually causes the automation rule to revert to using the Automation for Jira user's time zone.

Is there a way to do this?

 

1 answer

0 votes
Kian Stack Mumo Systems
Community Champion
February 14, 2023

@Shane Cross

It sounds like there may be a configuration error somewhere in your Jira instance. I'm not sure you should be setting up the automation rules to convert dates/times. In theory, there should be a single time set for the instance, and then each user can update their own time zone preferences to reflect what that time is for them. If you try to set the values based on each users timezone, I don't think you will get the result you are expecting.

 

Have you checked both your personal preferences and the system settings to make sure that the timezone settings are as you'd expect?

Shane Cross February 15, 2023

Yes, I have.  The problem that I'm having is that when the automation rule is applied, it's using the Automation for Jira user's time zone, instead of the user who initiated the triggering action. 

An example:  

Jira Automation Unwanted Behavior.png

As you can see, I am the user that initiated the action, at February 13, 2023 at 8:52 PM.  My time zone is set to US/Eastern.  Transitioning the issue to Done triggered the automation rule to set the Completed date field.  The Automation for Jira user's time zone is set to Europe/London, so all automation rules that it applies will use that time zone when setting a date using the {{now}} argument.

Since we're going to have developers in many different time zones, I want the automation rule to set the Completed date field based on the time zone that the user who triggered the automation rule is in, and not the time zone that the Automation for Jira user is in.

Kian Stack Mumo Systems
Community Champion
February 15, 2023

@Shane Cross

I asked about the timezone settings because I am not seeing the same behavior in my instance. When I set the time to {{now}},  it reflects my timezone, regardless of  the rule actor I use.

There are a few more options you could  explore:

  1. Change the rule actor from  "Automation for  Jira" to the user that initiated the action. You can do this under the rule details.
  2. Try to use a post function instead of an automation rule. There is a built in  post function (Update issue custom field)  which allows you to set the value to %%CURRENT_DATETIME%%.

If neither of these work, you could try raising a  ticket with Atlassian.  Like I said, I'm not seeing the same issue in my instance, so this could be some sort of bug!

Thanks,

Kian

Suggest an answer

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

Atlassian Community Events