Hey Community,
Need a second pair of eyes here...
I have a user picker custom field on the creation screen for an issue..
I would like to put a condition that checks the field and ensures that it does not match the current reporter. I have tried to take a look online but can't see much.
I have tried writing the User Validator (JMWE app) validator on the create transition for the workflow...and have used the below condition for the user:
issue.reporter.accountId != issue.customfield_11209[0].accountId
This works but when testing it on tickets where i am expecting the result to be true. The execution is failing. trying to find out why.
thanks
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.
There was an error during the execution of your Jira expression
Evaluation failed: "issue.customfield_xxxxx[0]" - Property name must be a string, found: 0 (Number)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your single select custom field is not an array. Why are you using the [0]? The code should work exactly as I wrote it in my post.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On the validation if this
issue.customfield_XXXXX.accountId != user.accountId
is true, then the validation pass and the transition should continue. If the the user picker field is equal to the current user, then the validation should fail and the transition wouldn't continue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
it defaults to [0] when searching the custom field in the issue fields tab for JMWE. accountId doesn't seem to be a recognised property without it.
There was an error during the execution of your Jira expression
Evaluation failed: "issue.customfield_11209.accountId" - Unrecognized property of `issue.customfield_11209`: "accountId" ('accountId'). Type null does not have any properties
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seem to have got rid of that error message but still not seeing the correct result when testing.
Getting a false result even though my user is the current user and also the user in the custom field. Will mess around with it.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The error you reported earlier means that the field is empty. Were you testing with a value for that custom field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Uche ,
Is your field a single-user picker or multi-user picker?
Also, did you use the "Issue Fields" help tab to figure out how to test the value of the custom field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is a single-user picker. and yes i did use the help tab but there is no info there that helps with the current user aspect of it,
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right. The current user is described on the Globals help tab. You can refer to it as user.accountId
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.