Reorder JIRA workflow buttons

To change the order of transition buttons and ‘workflow’ menu items, you’ll need to add the property key ‘opsbar-sequence‘ to each workflow transition that you wish to re-order. To do it, please:

  1. Access the workflow transition’s properties:

Administration' » 'Workflows' » 'Your Workflow' » 'Your Transitions' » 'View properties of this transition'

  1. Type opsbar-sequence into the ‘Property Key‘ field in the ‘Add New Property‘ section;
  2. In the ‘Property Value’ field, type a positive integer value (starting at ‘0’) that defines the order of the transition action on issue views (lower values equals the first transitions to appear);
  3. Click the ‘Add’ button

JIRA – Pre-populating Summary Field

If you wish to pre-fill the summary field on only one issue type, rather than globally, do the following:

  1. Create a custom field (I chose Multi Checkboxes, but  Free Text Field (unlimited text) will also work (please note that these fields will show, this is why I chose checkboxes)
  2. Assign custom field to the relevant issue type and project
  3. In the description field of the custom field, input the following:
<script type="text/javascript">
if (AJS.$("#summary").val().length <= 0){
AJS.$("#summary").val("Text to show");
}
</script>

That is it!

I decided to put my field in another tab of the create screen so that users don’t see it as easily, and with the multi-checkboxes custom field, with no values, users cannot select anything.

How to Strip the Old Reply Data from Email in JIRA When Using Outlook

When replying to a received HTML format notification from an issue in JIRA, the old reply data does not strip out properly when using Outlook as the email client.

In JIRA 4.4.4, I have found that even if I enable “stripquotes=true” or not, JIRA does not strip quotes or signatures from email messages.

There are many methods to resolve (or at least a workaround to) this problem, most of which can be found here.

However, I have found that the best method (whilst not perfect, does a pretty good job) is the following:

Create two services. One being your standard mail handler for your project, and the second being a regex handler (for replies).

E.G.:

Service #1 (default project mail handler):

Handler: Create or Comment Handler

Handler Parameters: project=ITHD,createusers=false,issuetype=1,stripquotes=true,ccwatcher=true,splitregex=/From: *|On .*|wrote:|(ITHD).*|(Innovation in the*)|(—-Original Message—-)/

Service #2 (Regex handler):

Handler: Regex Comment Handler

Handler Parameters: project=ITHD,createusers=false,issuetype=1,stripquotes=true,ccwatcher=true,splitregex=/From: *|On .*|wrote:|(ITHD).*|(Innovation in the*)|(—-Original Message—-)/

This will allow any replies to tickets to have the regex enabled and applied. However, I have not managed to get the initial mail handler to apply regex on create issue. If anyone has any comments, please let me know!

Editing Closed Issues without Reopening in JIRA

Something I’ve found useful is using workflow properties to allow a jira-admin rights to edit closed issues. I started putting these workflow properties in so that any jira-admin, could edit a closed issue without having to reopen the ticket and mess up the issue’s change history. More on that in this link:

http://confluence.atlassian.com/display/JIRA/Workflow+Properties

You should have two properties set for this to work. The first makes the issue editable. The second specifies what group can edit at that specific workflow step.

1. Property Key = jira.issue.editable

Property value = true

2. Property Key = jira.permission.edit.group

Property Value = type-your-group-name

Source: https://answers.atlassian.com

JIRA – Email notification on file attachment

One of the issues that I find with JIRA, is that you cannot realistically have “notification on issue update” enabled, due to the amount of emails you will get that don’t have useful information.

The way I got round this is to create a custom email listener.

  • Go to “Administration” > “Plugins” > “Script Listeners”.
  • Create a new listener as “Send a custom email”
  • Events: Issue Updated
  • Projects: Choose a project of your liking, or choose All Projects
  • Condition: attachmentManager.getAttachments(issue) && changeItems.any {it.get(‘field’)==’Attachment’} && ! issue.securityLevel
  • E-Mail Template: This ticket has an update regarding attachments.

    If a new attachment has been addded, it will be attached above. Latest attachment updated by $currentUser

    If an attachment has been deleted from the JIRA ticket, this is a notification of that action.

    Click here to view ticket: ${baseUrl}/browse/$issue.key

    Please do not reply to this email. This is a notification only.

  • Subject template: ($issue.key) $issue.summary
  • To Issue Fields: assignee reporter watchers
  • Include attachments: New

This should allow you to get a notification for all new and deleted attachments, as well as an email with a link to the issue.

JIRA Auto-Re-index

It can be helpful to schedule a re-index of issues after hours. Here is the shell script that can make that happen:

#!/bin/sh
### SETTINGS ###
USERNAME=<admin_username>
PASSWORD=<password>
DASHBOARD_PAGE_URL=http://<JIRA_URL>/secure/Dashboard.jspa
INDEX_PAGE_URL=http://<JIRA_URL>/secure/admin/jira/IndexReIndex.jspa
COOKIE_FILE_LOCATION=jiracoookie
### COMMANDS ###
curl -u $USERNAME:$PASSWORD –cookie-jar $COOKIE_FILE_LOCATION –output /dev/null $DASHBOARD_PAGE_URL
curl –cookie $COOKIE_FILE_LOCATION –header “X-Atlassian-Token: no-check” -d “indexPathOption=DEFAULT” -d “Re-Index=Re-Index” -d “indexPath=” –output /dev/null $INDEX_PAGE_URL
rm $COOKIE_FILE_LOCATION

Creating a new issue in JIRA via direct HTML link

It is possible to pre-define all the fields in a JIRA ticket so that when the user clicks on a HTML href link, the “Create Issue” form comes up populated with a default values. Here is an example:

https://www.icts.uiowa.edu/jira/secure/CreateIssueDetails\!init.jspa?pid=10041&issuetype=3&assignee=-1&priority=4&summary=Grant+%22Course+Creator%22+Role+for+User&components=10056&description=Please%20give%20me%20access%20for%0A%0A...

To create an issue ticket with defaulted values in JIRA via an URL, simply specify the following instead of the usual “CreateIssue.jspa” application name in the URL:

CreateIssueDetails!init.jspa

Continue reading

Due date reminder email in JIRA

If you are using JIRA as a helpdesk, the “Due Date” feature is a bit useless if you do not get an email reminder.

To accomplish this, do the following:

From Atlassian support:

1. Create a search filter in JIRA. You can use the following JQL: project = project = “IT HelpDesk” AND duedate >= 10d
2. Save the result as a Filter
3. Add the user to subscribe to this filter
4. The user will get notification automatically when the condition is met

Whilst this is a great starting point, this needed to be modified to work with all users in a project:

project = “IT HelpDesk” AND assignee = currentUser() AND duedate <= endOfWeek() AND duedate >= startOfWeek() AND resolution is EMPTY ORDER BY priority ASC, key DESC

The filter is broken down to the following:

Project is IT Helpdesk

  • Assignee is for whoever is logged in at the current time. This will save having to create multiple filters.
  • Due Date constrains searches to tickets only within a European (Monday start) week.
  • Resolution EMPTY only shows tickets who’s resolution is “unresolved”
  • Order by orders the search by priority. Blocker/Critical first.