The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Brian Selewski
Contributor
September 1, 2022

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:

Location 

Start

End

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

2 votes
Mikael Sandberg
Community Champion
September 1, 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.

Vijay Venkataramani
Contributor
September 1, 2022

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.

Chad Jackson
Contributor
September 2, 2022

@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 Champion
September 2, 2022

@Chad 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.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events