Hello Community,
We are using Custom field(Single line text field) in Create screen which contain "Asset ID".
Once user create one ticket, then he Should not create new ticket with same asset ID.
Ex: 1. First ticket contain "ABC123" in Asset ID field and create new ticket.
2. For Second ticket if user Enter "ABC123" in Asset ID field then error should display in Create screen and transition should be blocked.
Note: 1. One more condition, If user already created One ticket with "ABC123" and ticket is moved to done state and completed 3 months. then it should allow user to create new ticket with Same Asset ID "ABC123"
Is there any way that we can user any validators to completed this activity. Currently we are having "Script runner" and "JMWE" Plugins.
Thanks,
Prathap DL
Hi @PLaksh11 ,
For this, you'll definitely need scripted validators, as you cannot build something like this natively (at least not yet).
It can probably be built with something like this:
Retrieve the Value: Get the "Asset ID" entered by the user on the Create screen.
Run a JQL Query: Search for issues where:
The "Asset ID" field matches the current input.
The issue is not in a "Done" state OR it was resolved within the last 90 days.
Validation:
If the JQL returns any issues, the validator should fail and display your custom error message (e.g., "This Asset ID is already in use by an active or recently completed ticket").
If no issues are found, the transition is allowed.
However, I did not actually build this specific example to have a script or something ready. 👀
If you have Rovo, it should definitely be able to help you build the logic you can use here.
You could also reach out to Appfire or Adaptavist directly to see if they can provide actual examples of logic and scripts you could use here. 🎟️
Cheers,
Tobi
Thanks for the response.
We are raising ticket with Script runner team for the support.
Regards,
Prathap DL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @PLaksh11
I think this requirement is quite complex to implement on the Create screen because the app would need to continuously check the value entered in the Asset ID field against existing issues.
ScriptRunner Cloud is also more limited than ScriptRunner Data Center, especially for behavior feature
My suggestion would be to use Jira Automation instead:
Trigger the rule when an issue is created.
Use Lookup Issues to search for issues with the same Asset ID. If {{lookupIssues.size}} > 1, a duplicate exists.
Automatically close the newly created issue, add a comment explaining the reason, and link it to the existing issue.
This solution will not block the issue directly on the Create screen, but it is much simpler
Happy monday :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply.
We also have this in our mind as last option. If we are not able to achieve what we planned then we will use this as alternative approch.
Regards,
Prathap DL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.