Read more

Bookmarklet to generate a Pivotal Tracker story from Zammad Ticket

Daniel Straßner
November 12, 2019Software engineer at makandra GmbH

This is a bookmarklet you can add to Chrome or Firefox which will allow you to create a story in Pivotal Tracker from a Zammad ticket. This might come in handy when creating stories for SWAT Teams.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

But first you will have to set two variables in the script below:

  • pt_project_id: the ID of the Pivotal Tracker Project you want to add stories to. This can be found as part of the URL of the project (https://www.pivotaltracker.com/n/projects/<pt_project_id>)
  • pt_token: the Pivotal Tracker token used for authentication. Can be found in your PT profile or in ~/.config/geordi/global.yml if you have ever used geordi commit
javascript: (function() {
  var pt_project_id = 'XXX';
  var pt_token='XXX';

  var url = `https://www.pivotaltracker.com/services/v5/projects/${pt_project_id}/stories`;

  var data = {
    name: $('.ticket-title-update').first().text(),
    description: `siehe: ${window.location}`,
  };

  var headers = { 'X-TrackerToken': pt_token };

  $.post({ url: url, headers: headers, data: data }).done(function(res) {
    var story_url = res.url;
    window.open(story_url, '_blank');
  }).fail(function(response) {
    console.log(response);
    alert( "error logged to console");
  });
})();

Now create a new bookmark with arbitrary title and paste the modified script to the URL-field. Don't worry about the newlines in the script.

Posted by Daniel Straßner to makandra dev (2019-11-12 15:28)