This is a bookmarklet you can add to Chrome or Firefox which will allow you to create a story in Pivotal Tracker from a any URL. This might come in handy when creating stories.
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
Just create a new Crome Bookmark with arbitrary title and paste the modified script to the URL-field. Don't worry about the newlines in the script.
javascript: (function() { var jq = document.createElement('script'); jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); jQuery.noConflict(); var $ = window.jQuery; var pt_project_id = 'INSERT_PROJECT_ID'; var pt_token='INSERT_API_KEY'; var url = `https://www.pivotaltracker.com/services/v5/projects/${pt_project_id}/stories`; var title = prompt('Введите название истории в PivotalTracker', document.title); if (!title) return; var data = { name: title, description: `siehe: ${window.location}`, labels: ['inbox'] }; 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"); });})();
Add deskription