You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I have a webitem displayed on my issues that will generate a username and password. It's hooked up to a web resource like so:
js/user-cred-gen.js:
AJS.$(document).ready(function () {
function genUserCred() {
var issue = JIRA.Issue.getIssueKey();
let url = `/rest/cb-automation/latest/hooks/e6f8904f78fbf84cbb52ce913b553553968b2b31?issue=${issue}`;
$.post({url: `${url}`, headers: { 'Content-Type' : 'application/json'}}, function(result){
console.log("Ran successfully");
JIRA.trigger(JIRA.Events.REFRESH_ISSUE_PAGE, [JIRA.Issue.getIssueId()]);
});
};
function pollDOM(){
const el = AJS.$('#user-cred-gen');
console.log("Polling DOM for #user-cred-gen");
if (el.length > 0) {
AJS.$('#user-cred-gen').click(function(e) {
genUserCred();
});
}
else {
setTimeout(pollDOM, 300);
}
}
pollDOM();
});
When refreshing the page, the button works fine. However, if I edit a field on the customfield pane from the View Issue screen, the button no longer works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.