Hi Team,
I have written Javascript to set default description value for a project as below
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e, context, reason) {
var project = AJS.$('#issue-create-project-name').text();
var projectn = AJS.$('#project').val();
var isCreateIssuePage = AJS.$('#create-issue-dialog').is(':visible');
var itype =AJS.$('#issue-create-issue-type').text();
var issueType = AJS.$('#issuetype-field').val();
if(project == 'Support - Lifecycle Tools' || projectn =='11805'){
//alert('lcsppt')
if (issueType == "Defect" || issueType == "Task" || itype == "Defect" || itype == "Task"){
//alert('itype')
if (isCreateIssuePage == true || AJS.$('#content .aui-page-header-main h1').text() == "Create Issue") {
//('oncreate')
if (document.getElementById("description").value =="") {
//alert('nodesc')
AJS.$("#description").val("<b>Context</b><h3>What is the requested change?</h3> \n <p><describe the request here></p> \n<h3>Why is this change needed?</h3> \n <p><describe the motivation here></p> \n<h3>What is the impact to existing process, tools, and stakeholders? </h3>(if known): \n <p><describe the impact here></p> \n<h3>Steps to perform/reproduce </h3> \n <p> <ol class= olnospace><List the planned activities or steps to reproduce the fault (defects only)></ol></p> \n<h3>Acceptance Criteria </h3> \n <p><List the expected output to be completed before this ticket can be closed> </p> ");
}
}
}
}
else{
AJS.$("#description").val("")
}
});
When I am changing project,description field value is not getting cleared. Can anyone help me on the same?
Community moderators have prevented the ability to post new answers.
Hi Vineela,
unfortunately there is no help under way but more a general hint: customized Java Script many times in the past caused trouble - it is not recommended anymore.
In cloud plans for example it is completely not possible to set it like this.
I saw instances where this was introduced many years ago and now the JS code was remove due to incompatibilities.
More stable it a solution using Behavious but the App needs payment.
Cheers,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.