Hi,
I have a field mandatory in couple of projects sharing a single workflow.
I am making this field mandatory using workflow validators on create issue screen for all these projects.
Now there is a project (ABC), and I don't want the field to be mandatory in it.
Could someone tell me how to do that?
How can I make an exception for that project without disturbing all the other projects?
P.S. Creating a new field configuration is not ideal for me. And would be the last approach.
Many thanks,
Tayyab
Field configurations make field mandatory from creation time, so I assume you're using validators because you need them optional for part of the lifecycle. (If you need them mandatory throughout, then you absolutely should be using field configurations)
So, the simple approach - copy the workflow in use, put it in a new workflow scheme for the new project, and strip the validators out of it.
I would need to create both a new workflow and a new workflow scheme for it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, that's one of the things workflow schemes are for - to allow issues to follow different processes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- !
In our server Jira we have a mandatory field and it has to be mandatory indeed. We did it with field configuration. But there is only one case we need this field not mandatory - when there is a specific label. e.g. "NotRequired". Is there a way to avoid this mandatory rule during creation an issue using Scriprunner only in this specific case?
Something like this:
def label = labelsField.getValue() as String
def isLabel = label == "NotRequired"
customfield_12345.setRequired(! isLabel)
Can I use it as a post-function during creation?
With kind regards
Slava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, you can't override that mandatory flag.
If you blank out the field with Scriptrunner, people won't be able to do anything with the issue (other than rank it and report on it) until someone has gone back into it and edited it to fill in the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Nic Brough -Adaptavist- thanks for the answer!
If you blank out the field with Scriptrunner, people won't be able to do anything with the issue (other than rank it and report on it) until someone has gone back into it and edited it to fill in the field.
Nic, it's what exactly we need!
How could we implement this feature on creation?
Can we do this without Behavior?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm pretty sure you can write a post-function that clears out a field on the create transition (you can definitely do it on other transitions), as it executes after all the validation things.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough -Adaptavist- I forgot to say one important thing: issue is created from an external system (salesforce) and this type of field can't be populated (this is the reason we want to avoid system mandatory rule). We put specific label "salesforce" to know it is from there.
Any chance to avoid it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No. You need to fill in mandatory fields when you create the issue.
You can blank them out later with code, but the whole point of mandatory fields is that they are mandatory.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can blank them out later with code, but the whole point of mandatory fields is that they are mandatory.
Many thanks @Nic Brough -Adaptavist- , we will try to find something else, or better to improve the behavior of Salesforce. Have a nice day and week!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would reccomend to use field configuration scheme beacause it garantee that after creation value for these fields will not be set to null. And these make it simpler to use the same workflow into different projects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I created a new field configuration, but since the fields are being made mandatory using a workflow validator, I can't make them optional with the new field config, right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are rigth. That is field configuration for. You have the same workflow, but different mandatory fields into different projects.
In your case I would reccomend you to define where to reasilse logic for mandatory fields: into field config or into workflow validator.
Benefits for field config:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Plus, with field configs, you can carry on using the same workflows.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to use script runner plugin then You can use a behaviour section to make a field mandatory for a specific project and issue type
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.