Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How do you use automation to block an issue from being created when certain criteria are not met?

I'm trying to create a way of reserving an office space.  I have created a request type and issue with the following required fields:




The location is a list, the start and end fields are day and time. 

I am trying to set up an automation rule to prevent anyone from entering the same location as another ticket with a similar date and time.  

I think I can use JQL  query or a compare to block the issue from being created, I'm just having trouble coming up with the query or figuring out how to compare. 

The issue and request type are "Hoteling", I'm just not sure how to reference comparing if the new ticket I'm creating has the same location and similar start and end to block it from being created and make the user select a different location. 


Any help would be greatly appreciated.  

1 answer

1 vote
Mikael Sandberg Community Leader Sep 01, 2022

You cannot use automation for this, automations are running after the issue has been created. You would need to use a validator in order to do this, and most likely Scriptrunner that allows you to create scripted validators.

Like the suggestion. Also came to know about the scriptrunner while reading this. TY for that @Mikael Sandberg . 

@Brian Selewski  - If you do not mind a follow up to inform if this works out for you will really help us too.

@Brian Selewski  Like Mikael stated this can only be done using validators. The issue I have come across using validators is it has an effect on the whole workflow so if you are using a shared schema / workflow there may be a need to add an additional workflow. Also in my limited experience I have found that in a set Schema an Issue type can only be used in 1 workflow.  

@Mikael Sandberg  Looking at Script Runner can you elaborate on your uses of this? I am new to Jira and JSM and am curious how this is being used and I not finding any use cases explaining how Script Runner solves workability issues in JIRA? Thank you

Mikael Sandberg Community Leader Sep 02, 2022

@Chadwick Jackson I no longer using Scriptrunner after I switched company and went all cloud. At my previous place we used Scriptrunner and validators to prevent issues to move forward unless specific conditions were met. We also used it to do post-function calculations to get the risk value based on what the user selected from specific fields.

Suggest an answer

Log in or Sign up to answer
Site Admin

Atlassian Community Events