Hello everyone,
i want to add a validator on the create transition of a workflow. For a request type a few fields should be marked as required when creating a request from the jira backlog (not the portal) no matter how i am configuring it it just won't work.
Everytime I am testing the validator while configuring it with existing issues it works. but when a new issue is created it just won't.
i have tried writing my own script via jmwe:
!(!!issue.customfield_10010 && issue.customfield_10010.requestType.id == '325' &&
(issue.customfield_10424 == null || issue.customfield_10414 == null || (! issue.customfield_10004 || ! issue.customfield_10004.value) || (! issue.customfield_10162 || ! issue.customfield_10162.value))
)
and I tried to add a validator for every single field (screenshot) nothing worked.
Can anybody help me?
Best regards
Simone
Hi @Simone Kaden ,
this is caused by a know Jira issue: the correct customer request type is not set on the issue when Validators run on the Create transition. See https://ecosystem.atlassian.net/browse/ACJIRA-2532
I recommend you open a support request with Atlassian and tell them that you are impacted by this bug.
The obvious question is "why not make the fields mandatory in the field configuration"? This shouldn't affect the requests as field config is for issues, not requests.
Ignoring that, I can do a bit of explanation, but not help a lot. Validators check that data is set before allowing a transition. They have that data when transitioning issues, but when creating issues, they don't actually have anything. The expression in your code works with data current;y on the issue and how it changes, but there is nothing there when you are creating an issue!
Your code needs to be looking at the entered data, not the data on the issue (that isn't yet there). I do not know if JMWE has a way to do that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answer! For the issue type there are several request types but only one of them should have certain fields marked as mandatory in the backend. Therefore i cannot use the field configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Er, you can have different field configurations by issue type. Check the project's field configuration scheme.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes of course. But the issue type "Service Request" can only have one field configuration, right? So with my issue type there are at least 5 different request types which all use different fields and all of them need different fields to be marked as required. And that is something i cannot do with the field configuration scheme.
I don't think you are getting my point, but thats okay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, but that's the point - different service request types can be backed by different issue types, which can have different field configs.
You can set up
Service Request type 1 -> Issue Type 1 -> Field configuration 1 with mandatory fields
Service Request type 2 -> Issue Type 2 -> Field configuration 2 with only summary mandatory
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.