Skip to main content
Skip table of contents

Booking Auto-Approval

The scheduling configuration has been improved as part of Golive 9.23. If you are using Golive 9.23 or a newer version, please refer to the Scheduling Environments section. If you are using an older version of Golive, consider upgrading. Alternatively, you can refer to the documentation below for configurating your environment scheduling.

Pre-requisite: Environment Booking Setup as per our Environment Booking Documentation

In our Environment Booking, the process of approving or rejecting an Environment Booking Request is done manually. In order to avoid this manual work, you may want to automatically approve your booking requests when no conflicts are detected. This can be done with a simple Jira Automation rule and here is how:

https://www.loom.com/share/034f1339db904aa7908e367eb68bc374?sid=11190c35-9b4b-490e-857d-782970337a23

1. Update your Booking Request workflow

Make sure that all your statuses can transition to the “In review” status.

2. Create a new Automation Rule

Create a new Automation Rule in Jira Settings -> System -> Global automation

Create a new rule for your Auto-Approval

And implement the following automation steps (detailed in the next sections):

Steps required in your automation

3. Trigger: Field value changed

Define your trigger

4. Condition: Booking Request issue type

Limit the execution to your "Booking Request" issue type

5. Conditions: Fields are not empty

Let's ensure that all 3 fields to be used are filled in. For each of them, we use a "does not match regular expression" condition.

Start time

We make sure the “Start time” field is not empty.

First value (replace “Start time” with the name of your date/time custom field, if different)

CODE
{{issue."Start time"}}

Regular expression

CODE
(^null$|^$)

End time

We make sure the “End time” field is not empty.

"End time" should no be empty

First value (replace “End time” with the name of your date/time custom field, if different)

CODE
{{issue."End time"}}

Regular expression

CODE
(^null$|^$)

Environment(s) to book

We make sure the “Environment(s) to book” field is not empty.

"Environment(s) to book" should no be empty

First value (replace “Environment(s) to book” with the name of your environment custom field, if different)

CODE
{{issue."Environment(s) to book"}}

Regular expression

CODE
(^null$|^$)

6. Lookup issues: search for conflicts using JQL

Use a JQL query to search for conflicting Booking Requests

Here is our JQL using smart values, feel free to adjust it to your needs.

SQL
type = "Booking Request" AND key != {{issue.key}} AND "Start time" < "{{issue.End time.convertToTimeZone("UTC").jqlDateTime}}" AND "End time" > "{{issue.Start time.convertToTimeZone("UTC").jqlDateTime}}" AND "Environment(s) to book" IN ({{#issue."Environment(s) to book"}}"{{value}}"{{^last}}, {{/}}{{/}})

If your Jira Cloud "Default user time zone" is not UTC time zone, you have to update the JQL query to match your Jira Cloud time zone.

You can find your Jira Cloud time zone in System > General configuration > Default user time zone. And here is the list of corresponding time zones to be used in your query.

For instance, for "Europe/Zurich" time zone, you should update the query as followed:

"Start time" < "{{issue.End time.convertToTimeZone("Europe/Zurich").jqlDateTime}}" AND "End time" > "{{issue.Start time.convertToTimeZone("Europe/Zurich").jqlDateTime}}"

7. If block: lookupIssues is empty and current status is not APPROVED

We want to execute the instructions in this block only:

  1. if lookupIssues is EMPTY, and

  2. if the current status is not APPROVED, IN PROGRESS or DONE already

CODE
{{lookupIssues}}

8. Transition to the APPROVED status

9. Else block

We want to execute the instructions in this block only:

  1. if lookupIssues is not EMPTY, and

  2. if the current status is not TO REVIEW already

CODE
{{lookupIssues}}

10. Transition to the IN REVIEW status

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.