Announcement Banner

Dan27
Contributor
November 24, 2018

Hi,

I made this script, and all of the fields worked ok, instead one field only in Edit screen..

This field didn't work on Edit screen: #rowForcustomfield_14307

This is the only field that we didn't create new one, We took an old field and rename it.. 

This is the script:

<script type="text/javascript">
jQuery(document).ready(function($) {
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
callFunction();
});
callFunction();
function callFunction(){
if(document.getElementById("issuetype-field")!=null)
{
if((document.getElementById("issuetype-field").value == "Bug-Customer")||(document.getElementById("issuetype-field").value == "Bug-Internal")||
(document.getElementById("issuetype-field").value == "RFE")){


AJS.$('#customfield_10801').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#customfield_11507').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#customfield_14307').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#summary').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#priority').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#status').parent().children().first().attr("style","font-weight: bold;color:#191970")
}
}
else if(document.getElementById("issuedetails")!=null)
{
var TypeView= AJS.$("#issuedetails .item #type-val").text();
var TypeViewVal= TypeView.trim();
if (TypeViewVal=='Bug-Customer' || TypeViewVal=='Bug-Internal' || TypeViewVal=='RFE')
{

AJS.$('#rowForcustomfield_10801 strong').attr("style","font-weight: bold;color:#191970")
AJS.$('#rowForcustomfield_11507 strong').attr("style","font-weight: bold;color:#191970")
AJS.$('#rowForcustomfield_14307 strong').attr("style","font-weight: bold;color:#191970")
AJS.$('#issuedetails .item.item-right strong').first().attr("style","font-weight: bold;color:#191970")
AJS.$('#issuedetails .item.new strong').attr("style","font-weight: bold;color:#191970")
var Links= AJS.$('.links-list')
var title = document.getElementsByTagName("DT");
for(var i=0; i<Links.length; i++){
if(title[i].innerHTML == 'Salesforce Case'){
var div = document.getElementsByClassName("links-list");
var nodelist = div[i].getElementsByTagName("DD").length;
for(var j=0; j<nodelist; j++){
var ids = div[i].getElementsByTagName("dd")[j].id;
document.getElementById('delete-link_' + ids).style.visibility= 'hidden';

}
}
}
if(document.getElementById("edit-issue-dialog"))
{
AJS.$('#customfield_10801').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#customfield_11507').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#customfield_14307').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#summary').parent().children().first().attr("style","font-weight: bold;color:#191970")
AJS.$('#priority').parent().children().first().attr("style","font-weight: bold;color:#191970")
}
}
}

 

}
});
</script>

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events