Hi community.
I'm trying to show a message after I removed an issuelink from issue view.
I think this line is not correct, anyone can help me with these parameters?
sas_after_removed_link(GH.IssueView, '_removedLinkedIssue'', fn)
AJS.$(document).ready(function () {
function sas_afterIssueRendering(e) {
setTimeout(checkMessages, 2000);
setTimeout(checkMessages, 4000);
}
function checkMessages() {
var issue = JIRA.Issue.getIssueKey();
var user = JIRA.Users.LoggedInUser.userName();
fetch(AJS.params.baseURL+"/rest/MYPLUGIN/1.0/Message?issueKey="+issue+"&username="+user+"&delete=true")
.then(function(response) {return response.json();})
.then(function(data) {
for(var i = 0; i < data.length; i++){
var msg = data[i]
switch(msg.type){
case "WARNING":
AJS.flag({type:'warning', body:msg.body});
break;
case "INFO":
AJS.flag({type:'info', body:msg.body});
break;
case "ERROR":
AJS.flag({type:'error', body:msg.body});
break;
case "SUCCESS":
AJS.flag({type:'success', body:msg.body});
break;
}
}
})
}
sas_after_removed_link(GH.IssueView, '_removedLinkedIssue', sas_afterIssueRendering)
function sas_after_removed_link(object, method, fn) {
var originalMethod = object[method];
object[method] = function () {
originalMethod.apply(object, arguments);
fn.call(object);
}
}
document.addEventListener('aui-flag-close', function(event) {
if (event.target.querySelector(".aui-message-warning")) {
location.reload();
}
});
});
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.