Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Requires jQuery! -->
- <script>
- // Requires jQuery!
- var dispName = $("meta[name='ajs-user-display-name']").attr('content');
- var artName = $("meta[name='ajs-page-title']").attr('content');
- var spaceName = $("meta[name='ajs-space-name']").attr('content');
- var spaceKey = $("meta[name='ajs-space-key']").attr('content');
- var currentURL = window.location.href;
- var bodyText = 'Article URL: ' + currentURL +'\n';
- bodyText += "==== Please include details below ====";
- var summaryText = "Feedback on Wiki Article: " + artName;
- // Requires jQuery!
- jQuery.ajax({
- url: "https://JiraServerHere.com/plugins/servlet/issueCollectorBootstrap.js?collectorId=8c0e3a2f&locale=en_US",
- type: "get",
- cache: true,
- dataType: "script"
- });
- function getCurrentUserName(inVar) {
- var user;
- var emailaddr;
- jQuery.ajax({
- url: "/rest/gadget/1.0/currentUser",
- type: 'get',
- dataType: 'json',
- async: false,
- success: function(data) {
- user = data.username;
- emailaddr = data.email;
- }
- });
- if (inVar == 'username') {
- return user;
- } else if (inVar == 'email') {
- return emailaddr;
- } else {
- return user;
- }
- }
- window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
- // ==== custom trigger function ====
- triggerFunction : function( showCollectorDialog ) {
- $('#feedback-button').on( 'click', function(e) {
- e.preventDefault();
- showCollectorDialog();
- });
- },
- // ==== we add the code below to set the field values ====
- fieldValues: {
- summary : summaryText,
- description : bodyText,
- email : getCurrentUserName('email'),
- fullname : dispName }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement