Hi Community,
I have a question, can a condition be made that one user cannot close a ticket if there has ever been an assaignee on the ticket?
This would achieve the principle of 4 eyes for security problems in our Workflow. Can anyone help me here?
Best regards
Jurica
Hi @Jurica Petricevic ,
using JMWE, you could use a Scripted (Groovy) Condition with this script:
issue.getFieldHistory("assignee").size() > 0
This will check if the Assignee field was ever modified (which is equivalent to saying it was assigned to someone at some point)
Yes, but in our case more users can be exchanged at one ticket. None of them can close the ticket.
No one who was involved in the solution should be able to close the ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So what you mean is that you don't want a user to close a ticket if the same user was ever were assigned to the ticket before?
If so, this is the script you want:
!issue.getFieldHistory("assignee")?.find{it.to == currentUser.key}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David, I'm not sure why but it doesn't work? Is it still Scripted (Groovy) Condition?
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.
quite normally any user who is currently assignee but also one who has been can close a ticket.
and i need this:
"So what you mean is that you don't want a user to close a ticket if the same user was ever were assigned to the ticket before? " exactly that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So you created a Scripted (Groovy) Condition, put in the script I provided, published your workflow, and a user who is the current assignee or a past assignee can still see the transition?
I tested the same and it worked just fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Forgive me David for being late. The request changed a little bit at the last meeting. The ticket should not be closed by anyone who worked on the last status. What does that mean? The one who clicked the transition "test" cant close the ticket. Do you have any idea how to solve this?
Only the one that said am ready for test, transition called "Test" shouldnt be able to "Close".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jurica Petricevic ,
there are multiple ways to achieve this. You could "memorize" the user who triggered the "Test" transition in a Single User Picker custom field, using a Set Field Value post-function. Then you could simply make sure the current user is different from that memorized user:
currentUser != issue.get("Tester")
If you don't want to create a new custom field for that, you could use this condition directly:
!ComponentAccessor.changeHistoryManager.getAllChangeItems(issue)
.any{it.field=="status" && it.to == "In Test" && it.user == currentUser.key}
Note that "In Test" in the script represents the Status name of the destination status of the Test transition, not the transition name which is not memorized by Jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The perfect solution. Thanks a lot David.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this case you should have the history of those assigned in this field which is quite complicated. What you could do is have a multiple user type field (It can be hidden from the user) and every time the assign is changed, the user joins that field.
This will then allow you to compare the list of users of the field with the one that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I need 100 new fields in that case because so many users change on one ticket. Also, I'm not sure how to check all 100 and allow someone to close / test the solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.