You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I want to create an automation that prevents a task from being created twice by mistake. For this I need a JQL that searches for 4 characters (numbers or letters) between two underscores in the summary (e.g. _0110_), since these are contained in the summary of each project. If there is already a project that contains exactly these four characters in its summary, the creation of the task should be prevented.
How must the JQL look like for this?
Jira automation, if you are thinking of implementing your thought with that, it will not be of any use. Jira automation is executed as a post function and not as a validator.
Out of the box you can't search for this, meaning a set of substring located between two other characters (you could use smart values on Jira automation, but again this would not prevent your users for creating a subtask). You will need an app like JMWE, JSU, JWT. Do you have any of that?
You could use a Jira expression validator to validate the summary of the newly created issues with an expression similar to the following one:
!issue?.summary.includes("_10011_" || "_10012_")
In this case, the validator will allow the transition only if any of the texts between brackets is not included in the summary of the current issue.
Unfortunately, we are still unable to retrieve the summaries of the projects, so the texts between brackets will need to be hard coded into the expression.
I am part of the Support Team for JWT. Please, do not hesitate to contact us if you have any question regarding JWT Cloud via our Support Service Desk.
Hello @Alex Koxaras _Relational_ ,
Thank you so much for responding to my question. If I understood it correctly, I would need to add the letters/numbers from all existing projects into the Jira expression validator to exclude that a project with the same characters is created twice, since matching is not possible automatically?
For all future created issues you have to add a validator on the create transition of all the issue types to which you want to include this restriction. E.g. If you want not to allow users to create Tasks and Bugs if their summary contains a certain "string", then you have to apply this validator to all separate workflows. If Task and Bug are using the same workflow, then you have to apply to it once.
@Pauline Hild sorry but I dont fully understand your requirement. You want to search for issue that contains any number between two underscores (_) and if you find such issue, then don't allow the creation of this issue?
Is the above correct?
From further search I did unfortunately I have bad news for you concerning at least my proposed solution: It seems that it's not possible to validate an issue against others, due to restrictions from Jira (to get a bit more technical you have to use only jira expressions and you can't use REST API to retrieve a collection of issues, against which you will run your jira expression).
So to get back to your initial query:
Unfortunately you can't prevent an issue of being created via the automation. As I said, the automation runs after the issue being created. So that's the time when the automation will run. Perhaps the only thing you could consider is if you want the user to create the issue, and have an automation deleting it afterwards.. If yes, let me know and I'll try to create this rule for you.