All the google and chatgpt in the world is getting me nowhere, so hoping someone here can help!
We are new to behaviors.
We have two fields; let's call them origin and customer. Both are on the Bug type and select lists.
If value "external" is selected in origin, we want the customer field to be required.
We want this to happen if external is chosen on create or edit.
I have tried so many permutations of the scripts and am not sure which would be closer. I don't see anything in the "Affected field/s" column on my behavior, and not sure how to add that, if that's the problem.
I'm sure I'm overlooking something simple so appreciate any help. Even the script on the examples didn't work.
Hello @Leigh Crawford
While I'm working out the solution, can you tell us what is the Type of the project/space this concerns? Get that by clicking the ... next to the project/space name and looking at what appears at the bottom of the pop-up.
For Company and Team Managed Software and Business Spaces what you want to do is possible only on the Create and workflow Transition screens. It is not possible to set a Select List field to Required in the View screen.
Refer to
In the Create screen and in a workflow Transition screen, the script would look like this:
const changedField = getChangeField();
if(changedField.getName() == "origin"
&& changedField.getValue().value == "external") {
getFieldById("customfield_12345").setRequired(true);
}else{
getFieldById("customfield_12345").setRequired(false);
}
customfield_12345 needs to use the ID number of you customer custom field.
One way you can get that id is by going to the Custom Fields administration page, finding the field, and then selecting the Contexts and default values action.
The URL of the new page will have the field ID at the end of it: i.e.
https://yourSite.atlassian.net/secure/admin/ConfigureCustomField!default.jspa?customFieldId=10059
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.