How do I write a JQL querey to show who activated a given transition in a workflow?

Mark Lawson February 20, 2017

I am working with a workflow where certain change proposals require approvals.  Approvals are given by activating a specific Transition button.  I would like to write a JQL query which tells me who actioned specific approvals for specific Issues.

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2017

You could start with filter for each user who can appove:

status changed from "open" to closed BY aproval

Mark Lawson February 21, 2017

We have a relatively large group of potential approvers and they are not in access-control-groups.  We have a relatively large group of users with a potential requirement to be able to extract data on who activated an approval Transition when.  For these reasons, I would like the solution to come from 'standard' or 'standard-configuration' options as opposed to plug-ins or any type of scripting.  A typical report would list: issue-key, summary, log-in of person who activated Transition 'X', date/time Transition 'X' was activated.  

Vasiliy Zverev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 22, 2017

Since there are several options to do this:

  1. Store user who make a transition into custom field. (you can not apply it to already existing issues. It is requred to fill this field manually)
  2. ScriptedField provided by ScriptRunner plugin to calculate user who performed this transition and when.

Is any suits you?

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 21, 2017

JQL functions are probably not the right answer here. Whenever you are asking "show me a list of (anything that is not issues)" then JQL functions normally won't be the solution.

I think you will probably want to write your own report or dashboard gadget, where one of the parameters is a jql query.

0 votes
Stefan Arnold
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 20, 2017

With normal jql functions its not possible, maybe with added Pluginfunctions, but not sure.

Why do you want to do this with a jql function? jql is used to query issues  so where do u want to use it?

What you could do is to use a customfield in which u write the currentUser in a postfunction. so u could list this field with the name of the person who made this approval in a filter.

Other way to find that information is directly on the database with a query like this:

SELECT a.author as 'doer' FROM changegroup as a JOIN changeitem as b ON b.groupid = a.id
WHERE b.field = 'status' AND a.issueid = ${issue.id} AND b.oldstring = 'In Progress' AND b.newstring = 'Review'
ORDER BY a.created DESC LIMIT 1

In this case i get the last person which made the transition from status "In Progress" to "Review" of an issue.

Iam using this in a groovy script to send the issue back to this person in a transition post-function.

I hope this helps you, else i need some more information

 

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events