Forums

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

Script to set the field value based on another field value

Srikanth Gogineni April 17, 2019

Hi , 

please find the below scenario.

i have two fields A and B

i want to calculate(division) the field A value by 3 and round the value( for example if the value is 1.6 then 2 ), which needs to be assigned  to field B automatically.

here is the below code which i tried in field A configuration.

<script type="text/javascript">

function setAgreedSLADAYS() {

var sessioncounter = document.getElementById("customfield_14921");

sessioncounter = sessioncounter.value / 3;

var setagreedsladays = Math.round(sessioncounter);

document.getElementById("#customfield_13892").value = setagreedsladays;

 

}

sessioncounter.onchange=function(){

                setAgreedSLADAYS();

}

</script>

 

Can anyone help with the above script .Thanks in advance.

1 answer

0 votes
Kumar
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 Leaders.
April 17, 2019

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events