Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How ca I make a custom field mandatory based on value of another custom field

Sharon Curtis December 5, 2022

I need to configure two custom fields to be mandatory based on another filed value at creation of account issue type. 

Please provide any helpful instructions on how to set this up in Jira software server. 

 

Thanks

Sharon

4 answers

1 vote
Amelie Winkler _Appfire_
Atlassian Partner
December 6, 2022

Hi @Sharon Curtis – Amelie from the Power Scripts team here. If you went down the Power Scripts route, you could solve your use case either via a Validator or via Live Fields.

Here is an example of a validator (however, please note that it would work for transitions only, so, for example, it wouldn't work on the edit screen): 

Here's an example of how to do it with Live Fields.

Let me know if you have any further questions or feel free to reach out to our support team who could help you set it up.

Best,

Amelie

Sharon Curtis December 8, 2022

Hi @Amelie Winkler _Appfire_,  

Where does the script get implemented within Jira project configuration.

 

Thanks

Sharon

Amelie Winkler _Appfire_
Atlassian Partner
December 8, 2022

Hi @Sharon Curtis – you would implement the script within the SIL Manager. Check out our Power Scripts master class which will help you get started.

If need help setting up your script, our 24h support team can always help you out!

0 votes
Sharon Curtis December 6, 2022

This is the script I have setup and its not working.  Can anyone provide any assistance.

 

//Role type script
<script type="text/javascript">
priority = document.getElementById('customfield_10302);
if ('customfield_10302) {
target = document.getElementById('customfield_12200);
// Set Role Type Field to not required when the Accounts value is not FC USGOV Account (SAT/PROD)
if (priority.value != 10413) {
targetField.setRequired(false);
}
priority.onchange=function() {
// Set Role Type Field to required when the Accounts value is FC USGOV Account (SAT/PROD)
if (this.value == 10413) {
targetField.setRequired(true)
} else {
// Set Role Type Field to not required when for everything else. This is a cover all.
targetField.setRequired(false);
}
}
}
</script>

0 votes
Georgia Beckers December 5, 2022

Hi Sharon. Does it need to be a standard issue type? I would recommend the use of a form if it's suitable for your situation, as you can have the conditional formatting

Sharon Curtis December 8, 2022
0 votes
Fabian Lim
Community Champion
December 5, 2022

Hi @Sharon Curtis

Out of the box this is not possible.  For server you will have to use plugins such as Dynamic forms, scriptrunner, or powerscripts for Jira.  The last two require some scripting.  

Regards

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.1.0
TAGS
AUG Leaders

Atlassian Community Events