| Name | Jira Transition Search |
|---|---|
| Version | 0.1 |
| Product Versions | 3.6+ |
| Author(s) | Philip Herbst |
| Homepage | |
| Price | Free |
| License | |
| JavaDocs | |
| IssueTracking | |
| Download JAR | jira-transition-search-plugin-0.2.jar |
| Download Source | http://svn.atlassian.com/svn/public/contrib/jira/jira-transitionsearch-plugin/trunk/ |
Description/Features
Two Custom Field types that let you search for the execution time and caller of a certain workflow transition
Usage
- download the plugin jira-transition-search-plugin-0.1.jar and put it into WEB-INF/lib
- Add the Custom Field in the administration section
There are two ways to configure the transition to search for. The first option is via atlassian-plugin.xml of the plugin. You have to choose the actionId for the whole plugin here(you can only search for a single transition).
<param name="actionId" value="5" />
This would be "Resolve Issue" of the standard Jira workflow. To find out the actionId you can either look into the XML description of the workflow or simply look at the workflow action links(action=<the value>) on the ViewIssue page.
The second option is to (mis-)use the description of the custom field. This way you can add multiple fields to search for different transitions.
Enter the name of the Action (not the i18n name) in the description of the field. For the standard workflow it would be "Resolve Issue" or "Start Progress", for example. If the name isn't found for the issue's worklow the plugin will fall back to the actionId in atlassian-plugin.xml.
- reindex Jira

You have to reindex Jira to search for older issues

Comments (20)
Nov 27, 2006
Bettina Zucker says:
Hello Philip, this plugin is a really useful one\! Until now I defined a special...Hello Philip,
this plugin is a really useful one!
Until now I defined a special custom field type for every transition I wanted to remember the last occurrence date.
This makes a lot of custom field types, because I have a lot of workflows and many many transitions.
This is the reason I immediately checked your plugin.
I used the second type of configuration (by action name in the description field) and my search yielded not only issues with the required action name, but in addition also the ones with actionId = 5.
Should I change the atlassian-plugin.xml I want to use the second type of configuration? How?
Cheers
Bettina Zucker
Nov 27, 2006
Philip Herbst says:
Hi Bettina, I think thats a bug. I guess you configured the field as "global" em...Hi Bettina,
I think thats a bug. I guess you configured the field as "global" embracing multiple workflows. And some of the Workflows don't contain the action name given in the description field. In this case the plugin will fall back to the actionId in atlassian-plugin.xml hence it will find "Resolve Issue" transitions as well . The easiest way to fix/configure this is setting actionId=-1 (for caller and execution time field). This way nothing will be indexed as no action with the Id -1 exists, I guess. I will upload the source code of the plugin soon
Cheers,
Philip
Dec 06, 2006
Allen Rohner says:
I'm running Jira Enterprise 3.6.3. I installed the plugin, and got it to work gr...I'm running Jira Enterprise 3.6.3. I installed the plugin, and got it to work great. However, after it was installed, all projects that did not have the search transition custom field (because they have different workflows), got NullPointerExceptions when attempting to re-index. For the projects and workflows where the search transition custom field were enabled, things worked fine.
I'm very interested in this plugin. If you could please fix this bug, or upload the source code of the bug so I can fix it, that would be excellent.
Dec 07, 2006
Philip Herbst says:
Hi, Could you post a snippet of the Nullpointer stracktraces? If you want to ha...Hi,
Could you post a snippet of the Nullpointer stracktraces? If you want to have a look at the code yourself the source is now available at http://svn.atlassian.com/svn/public/contrib/jira/jira-transitionsearch-plugin/trunk/
Cheers,
Philip
Feb 16, 2007
Andre Fontaine says:
Here's what I'm seeing: 20070216 13:14:52,793 indexerPool2thread9 WARN \index.in...Here's what I'm seeing:
2007-02-16 13:14:52,793 indexerPool-2-thread-9 WARN [index.indexers.impl.Default
CustomFieldIndexer] An exception thrown getting the custom field value for index
ing. Value for 'customfield_10070' (More Info Executor) not indexed.
java.lang.NullPointerException
at de.phil.jira.plugin.searchhistory.AbstractTransitionSearchField.getAc
tionID(AbstractTransitionSearchField.java:28)
at de.phil.jira.plugin.searchhistory.ActionExecutionCallerField.getValue
FromIssue(ActionExecutionCallerField.java:37)
at com.atlassian.jira.issue.fields.CustomFieldImpl.getValue(CustomFieldI
mpl.java:225)
at com.atlassian.jira.issue.index.indexers.impl.DefaultCustomFieldIndexe
r.addIndex(DefaultCustomFieldIndexer.java:50)
at com.atlassian.jira.issue.index.IssueDocument.getDocument(IssueDocumen
t.java:34)
at com.atlassian.jira.issue.index.IssueDocumentBuilderImpl.get(IssueDocu
mentBuilderImpl.java:14)
at com.atlassian.jira.issue.index.SingleThreadedIssueIndexer.indexIssue(
SingleThreadedIssueIndexer.java:187)
at com.atlassian.jira.issue.index.MultiThreadedIssueIndexer$IssueIndexer
Runnable.run(MultiThreadedIssueIndexer.java:94)
at com.atlassian.jira.util.concurrent.BoundedExecutor$1.run(BoundedExecu
tor.java:39)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
ker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)
Feb 16, 2007
Philip Herbst says:
Hi, I've uploaded a new version (replaced the old jar) of the plugin with an add...Hi,
I've uploaded a new version (replaced the old jar) of the plugin with an additional null-check so this error should not occur anymore. Does it work for you?
Cheers,
Philip
Feb 16, 2007
Andre Fontaine says:
Yes. No more indexing errors. Thanks.Yes. No more indexing errors. Thanks.
Mar 02, 2007
Matthew Janulewicz says:
Is there a way to get this plugin to populate a 'Transition Caller' field for it...Is there a way to get this plugin to populate a 'Transition Caller' field for items that already existed at the time the plugin was installed? This works great for new items and is extremely useful, but we have about a month's worth of old items that it would be really neato to have this work with.
Thanks!
-Mattyj
Mar 02, 2007
Philip Herbst says:
Hi, you have to reindex your Jira instance to populate the field for "older" iss...Hi,
you have to reindex your Jira instance to populate the field for "older" issues.
Hope that helps,
Phil
Mar 02, 2007
Matthew Janulewicz says:
It still doesn't seem to be working. I had indexed it before but I just did it a...It still doesn't seem to be working. I had indexed it before but I just did it again to be sure.
Also, I "reduced" my initial installation by assigning this field to only one issue type in one project. It still did not re-index the old issues, but it seems to be fine in filling in the field of new issues that pass through the designated transition.
We're running Jira 3.7.1 Enterprise Edition. I haven't a clue where to begin troublshooting.
It's not a huge deal, we've only been online with Jira for a month, so another month from now it won't matter, but it would be neat to get this data set retro-actively.
-Matt
Apr 05, 2007
Raghu Kumar C says:
Philip,...Philip,
If I have a workflow with few action names repeating but their id's are different; suppose I have an action 'Resolve Issue' with id=5 and another 'Resolve Issue' with id=781 will this plugin pickup both or just the first one? I am trying to use it by doing the second type of configuration, ie. by typing 'Resolve Issue' in the description field of the custom field.
I am using 3.7.4 Enterprise version.
Thank you,
Raghu
Apr 10, 2007
Philip Herbst says:
Raghu, sorry for replying so late. To answer your question: Version 0.1 will no...Raghu,
sorry for replying so late. To answer your question: Version 0.1 will not pick up "multiple" transitions (even Jira's standard workflow "Close Issue" transition has two ids). I've uploaded an updated version 0.2 which should address this problem. Could you try this version and tell if it works for you? I've only tested it locally with the standard workflow and it seems to work the expected way.
Cheers,
Philip
Apr 24, 2007
Zhu Yong says:
Philip I have tested your 0.2 version with JIRA 3.6.3, it works fine for most of...Philip
I have tested your 0.2 version with JIRA 3.6.3, it works fine for most of my issues in the database. But some issues doesn't work. Those doesn't work issues have the following extra history than those work.
Apr 26, 2007
Philip Herbst says:
Hi\! The problem is that the plugin only looks for transitions in the current pr...Hi!
The problem is that the plugin only looks for transitions in the current project/workflow. So if the issue was closed in another workflow and afterwards moved to a project with a different workflow, the plugin is not able to determine the right transition. I will look into this and try to fix that, if I can.
Cheers,
Philip
May 17, 2007
Michelle Litton says:
Hi Philip, I have run into this same issue, but in a slightly different manner.&...Hi Philip,
I have run into this same issue, but in a slightly different manner. I am not moving cases to different projects, but I am changing the workflow. My company is still "working out the kinks" for our final workflows for a few different projects. Each time I change the workflow, I have to switch it to a temporary workflow, make the modifications, then move it back. I'm only getting the updates for the transitions executed since the last workflow change.
I'd really appreciate it if you find a solution. Hopefully we'll get our workflow finalized soon.
At any rate - this is a really useful tool.
Thanks!
Chelle
Jul 12, 2007
Qnamic AG says:
Hi Philip, if there is more than one transition with the same name, only the id ...Hi Philip,
if there is more than one transition with the same name, only the id of the frist one is used in the query. I have created a patch to fix it. Take a look at it and, if appropriate, create a new version.
Thanks.
David
PS: There is no possibility to append a file
. Because of that, i post the content of the patch (jira-transition-search-plugin-0.1-0.1.1.diff) directly in the message.
Index: project.xml =================================================================== --- project.xml (revision 8428) +++ project.xml (working copy) @@ -6,7 +6,7 @@ <id>jira-transition-search-plugin</id> <name>Plugin project template</name> - <currentVersion>0.1</currentVersion> + <currentVersion>0.1.1</currentVersion> <organization> <name></name> Index: src/etc/atlassian-plugin.xml =================================================================== --- src/etc/atlassian-plugin.xml (revision 8428) +++ src/etc/atlassian-plugin.xml (working copy) @@ -2,7 +2,7 @@ name="Search Workflow Transition Plugin"> <plugin-info> <description></description> - <version>0.1</version> + <version>0.1.1</version> <application-version min="3.6" max="3.7" /> <vendor name="Atlassian Software Systems Pty Ltd" url="http://www.atlassian.com" /> Index: src/java/de/phil/jira/plugin/searchhistory/AbstractTransitionSearchField.java =================================================================== --- src/java/de/phil/jira/plugin/searchhistory/AbstractTransitionSearchField.java (revision 8428) +++ src/java/de/phil/jira/plugin/searchhistory/AbstractTransitionSearchField.java (working copy) @@ -2,6 +2,8 @@ import java.util.Collection; import java.util.Iterator; +import java.util.ArrayList; +import java.util.List; import org.apache.log4j.Logger; @@ -16,9 +18,10 @@ { private static Logger log = Logger.getLogger(AbstractTransitionSearchField.class); - protected Long getActionID(CustomField customfield, Issue issue) + protected List getActionIDs(CustomField customfield, Issue issue) { Collection actions; + List ret = new ArrayList(); try { actions = ManagerFactory.getWorkflowManager().getWorkflow(issue).getAllActions(); @@ -29,14 +32,17 @@ { String description = customfield.getRelevantConfig(issue).getCustomField().getDescription(); if (description != null && actionDescriptor.getName().toLowerCase().equals(description.toLowerCase())) - return new Long(actionDescriptor.getId()); + ret.add(new Long(actionDescriptor.getId())); } } } catch (WorkflowException e) { log.error(e); } - return getActionIDParam(); + if (ret.size() == 0) { + ret.add(getActionIDParam()); + } + return ret; } protected Long getActionIDParam() Index: src/java/de/phil/jira/plugin/searchhistory/ActionExecutionCallerField.java =================================================================== --- src/java/de/phil/jira/plugin/searchhistory/ActionExecutionCallerField.java (revision 8428) +++ src/java/de/phil/jira/plugin/searchhistory/ActionExecutionCallerField.java (working copy) @@ -34,7 +34,7 @@ public Object getValueFromIssue(CustomField customfield, Issue issue) { - Map value = workflowHistoryDAO.findWorkflowEntry(issue, getActionID(customfield,issue)); + Map value = workflowHistoryDAO.findWorkflowEntry(issue, getActionIDs(customfield,issue)); User caller = null; if (value.containsKey(WorkflowHistoryDAO.CALLER_KEY)) caller = (User)value.get(WorkflowHistoryDAO.CALLER_KEY); Index: src/java/de/phil/jira/plugin/searchhistory/ActionExecutionTimeField.java =================================================================== --- src/java/de/phil/jira/plugin/searchhistory/ActionExecutionTimeField.java (revision 8428) +++ src/java/de/phil/jira/plugin/searchhistory/ActionExecutionTimeField.java (working copy) @@ -37,7 +37,7 @@ public Object getValueFromIssue(CustomField customfield, Issue issue) { - Map value = workflowHistoryDAO.findWorkflowEntry(issue, getActionID(customfield,issue)); + Map value = workflowHistoryDAO.findWorkflowEntry(issue, getActionIDs(customfield,issue)); Timestamp finishDate = null; if (value.containsKey(WorkflowHistoryDAO.FINISHDATE_KEY)) finishDate = (Timestamp)value.get(WorkflowHistoryDAO.FINISHDATE_KEY); Index: src/java/de/phil/jira/plugin/searchhistory/WorkflowHistoryDAO.java =================================================================== --- src/java/de/phil/jira/plugin/searchhistory/WorkflowHistoryDAO.java (revision 8428) +++ src/java/de/phil/jira/plugin/searchhistory/WorkflowHistoryDAO.java (working copy) @@ -4,6 +4,8 @@ import java.sql.Timestamp; import java.util.HashMap; import java.util.Map; +import java.util.Iterator; +import java.util.List; import org.apache.log4j.Logger; import org.ofbiz.core.entity.DelegatorInterface; @@ -12,6 +14,7 @@ import com.atlassian.core.user.UserUtils; import com.atlassian.jira.issue.Issue; import com.opensymphony.user.User; +import com.sun.org.apache.xerces.internal.impl.xs.util.StringListImpl; public class WorkflowHistoryDAO { @@ -23,7 +26,8 @@ String ENTITY_DS = "defaultDS"; - private final String selectStatement; + private final String selectStatementPart1; + private final String selectStatementPart2; private final DelegatorInterface delegatorInterface; @@ -39,10 +43,12 @@ buffer.append(getTableName("Issue")).append(" issue INNER JOIN ").append(getTableName("OSHistoryStep")); buffer.append(" workflow ON ").append("issue.").append(getColName("Issue", "workflowId")); buffer.append(" = workflow.").append(getColName("OSHistoryStep", "entryId")).append(" WHERE "); - buffer.append("issue.").append(getColName("Issue", "id")).append(" = ? AND workflow."); - buffer.append(getColName("OSHistoryStep", "actionId")).append(" = ? ORDER BY workflow."); + buffer.append("issue.").append(getColName("Issue", "id")).append(" = ? AND "); + selectStatementPart1 = buffer.toString(); + buffer = new StringBuffer(); + buffer.append(" ORDER BY workflow."); buffer.append(getColName("OSHistoryStep", "finishDate")).append(" DESC"); - selectStatement = buffer.toString(); + selectStatementPart2 = buffer.toString(); } protected String getTableName(String entityName) @@ -55,17 +61,25 @@ return delegatorInterface.getModelEntity(entityName).getField(fieldName).getColName(); } - public Map findWorkflowEntry(Issue issue, Long actionId) + public Map findWorkflowEntry(Issue issue, List actionIds) { Map workflowEntry = new HashMap(); SQLProcessor sqlProcessor = null; ResultSet resultSet = null; try { + StringBuffer actionIdClause = new StringBuffer(); + Iterator actionIdIterator = actionIds.iterator(); + actionIdClause.append("workflow.").append(getColName("OSHistoryStep", "actionId")).append(" = ").append((Long)actionIdIterator.next()); + for (;actionIdIterator.hasNext();) + { + actionIdClause.append(" OR workflow.").append(getColName("OSHistoryStep", "actionId")).append(" = ").append((Long)actionIdIterator.next()); + } + String selectStatement = selectStatementPart1+"("+actionIdClause.toString()+")"+selectStatementPart2; + sqlProcessor = new SQLProcessor(ENTITY_DS); sqlProcessor.prepareStatement(selectStatement); sqlProcessor.setValue(issue.getId()); - sqlProcessor.setValue(actionId); sqlProcessor.executeQuery(); resultSet = sqlProcessor.getResultSet(); // Just the last entry if a transition was executed multiple timesJul 13, 2007
Philip Herbst says:
Hi! There's already a version 0.2 jiratransitionsearchplugin0.2.jar with the ch...Hi!
There's already a version 0.2 with the changes you mentioned here. The changes are quite similar to those you posted
See comments
I haven't updated the page nor committed the code though. Sorry for the hassle! Maybe I wanted to do something about the moving problem before I commit which I didn't find time to.
Cheers,
Philip
I will commit the changes to SVN asap
Jun 10
Jan Hruda says:
Hi there, I just want to ask if there is any possibility using this plugin to me...Hi there,
I just want to ask if there is any possibility - using this plugin - to measure time the issue was in a particular state. Its nice to know that certain issue was moved to "in progress" state on certain time and than have the same information about "solved" state. But i would like to know the exact days (hours..) the issue was in "in progress" which means i need to calculate the interval between those two values
Any suggestions?
cheers
jan
Jun 10
Matthew Janulewicz says:
The 'Jira Suite Utilities' plugin has this. Install that and enable the 'Transit...The 'Jira Suite Utilities' plugin has this. Install that and enable the 'Transitions Summary Tab Panel'.
As the name implies there is no way to run a report on this information, but each issue will then have a tab that shows the transitions, pre and post states, the time the transition occurred, etc.
Jul 21
William Halverson says:
My JIRA system info says I am using the Search Workflow Transition Plugin 0.1 Pl...My JIRA system info says I am using the Search Workflow Transition Plugin - 0.1 Plugin by Atlassian Software Systems Pty Ltd
So I don't know if in fact we have the 0.2 version of the plugin installed. I assume if we had the jira-transition-search-plugin-0.2.jar installed, JIRA System Info would should the 0.2 suffix?
My problem is that the transisiton values are not uniformly showing up in the fields. I have read the limitations (only current project/workflows) and that does not seem to be the explanation. What else could cause this kind of problem?
Thanks in advance for any ideas, and thanks for a really useful plugin!.
William