Jira v6.0.2 doesn't run the java script from a custom filed description during create ticket process

In my project, we have 2 custom fileds (A&B) where "B" should always match to the group name from A followed by some additional name tag (Ex: A=ROY_RO. "B" Should be ROY_Approver). So, i've the below java script written to compare the group name "ROY" between "A & B" and do an additional check on "_App" from custom field "B" and let user submit the ticket only if it mathces...

I've placed this script in the descriptiong filed of custom filed "B". But, while creating ticket, this script was never called and ticket gets create when "B" has a different Gourpname.

Has anyone tried this earlier?

<script type="text/javascript">

AJS.$(document).bind('dialogContentReady', function(event, dialog) {

var submit_btn = document.getElementById("create-issue-submit");

//adding event listner for the submit button

submit_btn.addEventListener("click", function(e){

//get the groupName

groupName = document.getElementById("customfield_13401").value.split("_")[0];

// create the compare string

group_Ind = groupName + "_App";

console.log('the group ind is :' + group_Ind)

// get the approver

approverEl = document.getElementById("customfield_13410");

approver = approverEl.value

// compare the group_Ind with the approver to check for the match

console.log(approver.substring(0,group_Ind.length));

if (approver.substring(0,group_Ind.length) != group_Ind){

e.preventDefault();

document.getElementById("customfield_13410").value = "Incorrect Value"

}

}

});

</script>

1 answer

Atlassian Group,

Can anyone help me with the information why Javascript is not been pickedup during ticket creation, Please?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,146 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot