Hello!
I'm trying to implement a validation check in a workflow that prevents the person who is transitioning a subtask to be the same person as the reporter of the parent issue.
So basically the current logged in user should not be the parent issue's reporter. I use Jira cloud and trying to use scriptrunner to do this
currentUser != issue.getParentObject().getReporter()
This is not working, what am I doing wrong?
Hi @Saira maybe issue.getParentObject() can return null
So issue.getParentObject().getReporter() can throw null pointer exception -> error
def parentTicket = issue.getParentObject()
parentTicket != null && (currentUser != parentTicket.getReporter())
or
issue.isSubTask() && (currentUser != issue.getParentObject().getReporter())
Remember to publish your workflow before performing the test
Best regards,
Hieu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.