The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Populate a number based on drop down selection

Kim Lupe
January 24, 2021

I need to create a file that will populate a value based on a yes or no selection

 

Example:

DROP DOWN FIELD: Improves Security? [yes, no]

NUMBER FIELD: If Improves Security  = Yes, then value = 10, else = 0

 

I have tried manipulating this formula from docs I have been reading with no success

<script type="text/javascript">
priority = document.getElementById('Improves Security');
if (Improves Security) {
target = document.getElementById('customfield_10728');
// Hide the target field if priority isn't critical
if (improves security.value != Yes) target.style.display='none';

priority.onchange=function() {
if (this.value == Yes) {
target.style.display = '';
target.value="10";
} else {
target.style.display='none';
}
}
}
</script>

 

 

Is there another simple script I can use to achieve this?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
mogavenasan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 26, 2021

Hi @Kim Lupe-Smith,

The script that you have posted here is a Javascript which on Jira Server, we can inject it on the Jira Announcement Banner. I don't think this applies to Jira Cloud. That being said, can I know how we are injecting the JS script into Jira Cloud?

On Jira Cloud, you should have the Jira Automation which can help you with this; Create and edit rules

I hope that this helps.

Thanks,
Moga

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events