Useful {{smart value}} for Jira automation

Useful {{smart value}} for Jira automation

Getting the Current Hour value by Time Zone:

If you want to check if the current time is between 8 AM and 5 PM in a specific time zone, this smart value will help you align actions based on business hours.

{{now.converToTimeZone("<timezone>").format("k")}}

Result: 0 - 24 in the specified time zone

💡
You can check Timezone code from here

Checking the Current Day name in a Specific Time Zone:

If you want to check the current day name (e.g., Mon, Tue, Wed) in the specified time zone. This can be particularly helpful for scheduling rules that only run on certain days.

{{now.convertToTimeZone("<timezone>").format("EEE")}}

Result: Mon, Tue, Wed, etc... in the specified time zone

💡
Where to Find Time Zone Codes?
To specify the <timezone> in your smart values, you’ll need the correct time zone codes. You can find the complete list of supported time zone codes in this Time Zone Reference.

Example Use Case:

Use case 1: Check if Now is Between 8 AM and 5 PM in Pacific Time Zone:

{{now.convertToTimeZone("US/Pacific").format("k")}}

Use case 2: Check if today is Tue day in Pacific time zone:

{{now.convertToTimeZone("US/Pacific").format("EEE")}}

With these smart values, you can make your Jira automation rules more precise and time-zone aware, ensuring they meet your specific operational needs.


Bonus: JQL Search to Check if an Issue Was Created More Than XX Hours Ago:

To search for issues created more than a specified number of hours ago, you can use the in the time field in Jira Query Language (JQL) along with the -Xh syntax.

Example Use Case:

Use case 1: Search for issues created more than 2 hours ago:

Search issues created more than 2 hour ago

Use case 2: Search for a custom field (e.g., "Assigned Date Time") with a value more than 15 hours ago:

Do you enjoy this blog post?

Read more