I was wondering whether it's possible to setup JIRA workflow in such way, that only specific user can change status of an issue. Basically, I would like to create transition condition like current_user == 'jira_robot'. I seem to be unable to get current user using custom condition script.
you are right, there is no "user = abc" condition. But there is a condition "User is in Group", so an easy way is to create a group and add the user to this group and add the "User is in Group"-condition to the transition.
Yes, this should be possible. There is an example here:
You get the currentUser as described in the example and compare that value not to "sponsor.name" as stated in the example but with your own string.
If someone is searching for the solution. You can use this code (jsut change USERNAME to the value that should be compared)
def TransitionUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() as ApplicationUser
passesCondition = TransitionUser.name == "USERNAME"
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG