I want to ensure that all issues of a given issue type are created via the Portal.
I have Cloud ScriptRunner and have written a Workflow Validator as follows:
(issue.properties['request.channel.type']['value'] == 'portal') ? true : false
I have successfully tested this against existing issues. However, when I add this condition to the Create transition, it always returns false. If I change the if condition from 'portal' to null, then it still returns false.
Am I doing something wrong? Are there any alternatives?
I have a similar issue.
Validator works when testing with JMWE addon, that is, making sure Reporter is in a group.
However, it has no effect on Service Desk portal and everyone can create the request type.
Hi Viktor,
Can you share what you configured? What you need is a Build-your-own validator with the following Jira expression:
user.groups.includes("jira-users")
It should block the user from creating the issue, but the error message displayed is the standard message and not the message configured in the validator. That is a known issue in Jira Cloud.
Regards,
Radhika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you.
Turns out I misclicked when I selected the Workflow issue type scheme.
Works now, but the validation error message, unfortunately, is not displayed on the portal.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On doing some more testing, it seems that issue.properties is null on issue creation. I guess this is by design?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nick HassellDone a few tests too. I think you are right. issue.properties value will be set after the issue creation. Thus, there is no way for checking if a user tries to create an issue from Jira/portal/API using a validator in Create issue transition.
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.