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?
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.
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.
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
The 2020 acquisition of Mindville added powerful asset and configuration management capabilities to Jira Service Management in the form of Insight. Following the completion of that integration, custo...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events