Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Brian Selewski 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

1 vote
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 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 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events