How can use validator, before create transition? please let me know.
What Thorsten suggested, you can also do that with scriptrunner, you'll need to script the condition however.
I have tested it and it works:
Scripted Validator Condition:
Error Message on Screen when you have a summary that already exists (e.g. what the script checks):
You cannot. Validators are associated with a transition. Depending on your goal you might consider an automation or scripting addon. Maybe if you describe your requirement we could provide a solution.
Validators, by definition, happen after someone has tried to make a change. They are there for checking input!
What you are looking for is more of a "condition", which is "can this be done? If not, don't even let the process start". When you're creating an issue, you can't do this - you don't have enough information in the workflow process. So there's nowhere to put a condition on create.
Jira does the condition before the workflow, and all it does is check the permission that a person has the right to create issues in that project.
Hi @Jack Brickey ,
I am trying to add validator before transition, the main purpose we can stop create issue.
I need help trying to find a way of stopping an issue being created if there is an open issue with a custom field value selected
Example:
Issue 1 is Open and Custom Field = 123
User tries to create Issue 2 and populates Custom Field with '123'. I want the creation to be stoppped with maybe an error message? and dont get created
This cannot be done thru a Validator as it only works on the transition and only assessing the current issue not looking a existing issues.
I’m unsure how to achieve this or if it is even possible. For sure you would require an addon. You might look at Scriptrunner, powerscripts, etc.
Hi @Venkatesh Bhureddy ,
as mentioned before this isn't possible out of the box. However, if using an additional app is a valid option for you, you might want to have a look at Jira Workflow Toolbox.
It allows you to validate against a JQL query to check if specific tickets already exist (see https://apps.decadis.net/display/JWT/Condition+and+validation+based+on+JQL+query). In your scenario, you would have to check for the custom field value.
Disclaimer: I belong to the team behind the aforementioned app.
CheersThorsten
@Leonard Chew
This is working Thanks Chew.
@Venkatesh Bhureddy , good job!
Just out of curiosity: You were able to get the "getIssuesByJQL()" function to work? Thats a custom function I wrote for more convenience, as I often use jql results in my scripts.
It looks like you're new here. Sign in or register to get started.