x x x
x
Only portrait mode is currently supported - please rotate your device.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

HTML
<script>

// Load startup cards
var data = await jQuery.ajax({
    url: "/rest/scriptrunner/latest/custom/searchJiraTicketsPaginated",
    headers: {
      'X-Atlassian-Token' : 'nocheck',
      'Content-type' : 'application/json'
    },
    type: "POST",
    dataType: 'json',
    data: JSON.stringify({
      "jql": "project = PGH AND status = Submitted AND resolution = Unresolved AND cf[10634] ~ 'approved' ORDER BY priority DESC, updated DESC",
      "startAt": 0,
      "maxResults": 4
    })
  }).then(res => res);
console.log("mazinmazinnnn")
for(let i = 0; i < data.issues.length; i++){
	let title = data.issues[i]['fields']['customfield_10108'];
	let summary = data.issues[i]['fields']['customfield_10226'];
	console.log(title, summary)
}

// ANALYTICS 

const trackPerksCardClicked = (perkCategory, perkTitle) => {
	analytics.track("perksCardClicked", {perkCategory, perkTitle});
}

const trackPerkCategoryClicked = (perkCategory) => {
	analytics.track("PerksCategoryClicked", {perkCategory});
}

$("#myCards-passportproperks .custom-card-container").each(function() {
  this.addEventListener("click", () => {
		let title = this.getElementsByClassName("card-title")[0];
		let titleText = title.innerHTML.trim();
		let category = this.getElementsByClassName("card-subtitle")[0];
		let categoryText = category.innerHTML.trim();
		trackPerksCardClicked(categoryText, titleText);
  });
});

$("#myCards-popularperks .custom-card-container").each(function() {
  this.addEventListener("click", () => {
		let title = this.getElementsByClassName("card-title")[0];
		let titleText = title.innerHTML.trim();
		let category = this.getElementsByClassName("card-subtitle")[0];
		let categoryText = category.innerHTML.trim();
		trackPerksCardClicked(categoryText, titleText);
  });
});

$("#myCards-newestperks .custom-card-container").each(function() {
  this.addEventListener("click", () => {
		let title = this.getElementsByClassName("card-title")[0];
		let titleText = title.innerHTML.trim();
		let category = this.getElementsByClassName("card-subtitle")[0];
		let categoryText = category.innerHTML.trim();
		trackPerksCardClicked(categoryText, titleText);
  });
});

$("#categories .custom-card-container").each(function() {
  this.addEventListener("click", () => {
		let category = this.getElementsByClassName("card-title")[0];
		let categoryText = category.innerHTML.trim();
		categoryText = categoryText.split('&amp;').join("&");
		trackPerkCategoryClicked(categoryText);
  });
});
</script>

...