Xporter and activity history

Nancy Blackwell
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.
April 18, 2013

Is there a way to get the activity history reported in a pdf through Xporter so that a viewer could see who moved an issue through the transition and the timestamp when it occurred? Or be able to see who updated the fields in change history?

3 answers

1 accepted

0 votes
Answer accepted
Nancy Blackwell
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.
May 1, 2013

I have found a work around - I created a scripted field that uses Free Text Field teamplate. Then added the groovy script to query the activity history and iterate through it. I then included that field in the exported pdf.

ComponentManager componentManager = ComponentManager.getInstance()
def changeHistoryManager = componentManager.getChangeHistoryManager()
def SimpleDateFormat formatter = new SimpleDateFormat("yyyy MM dd hh:mm")
def changehistoryItems = changeHistoryManager.getAllChangeItems(issue);
def StringBuffer html = new StringBuffer()
html.append "Issue $issue.key ChangeLog Items\n"
changehistoryItems.each{ historyItem ->
	def creationDate = formatter.format((java.util.Date)historyItem.created)
	if (historyItem.field =="status") {
		def from =  historyItem.froms.toString()
		def to  =  historyItem.tos.toString()
		html.append "\n Date: $creationDate From: $from To: $to by $historyItem.user."
	} else if (historyItem.field!="status") {
		def changehistories = changeHistoryManager.getChangeHistories(issue)
		changehistories.each() { changeHistory ->
			def changeitems = changeHistory.getChangeItemBeans()
			changeitems.each(){ changeItem ->
				if(changeItem.field == historyItem.field && changeItem.created == historyItem.created){
					html.append "\n Date: $creationDate $historyItem.field changed FROM $changeItem.fromString TO $changeItem.toString by $historyItem.user."
				}
			}
		}
		html.append "\n"	
	}
	
}

0 votes
Midori
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.
May 21, 2013

the scripted field is really clever workaround, but there is no need for the extra field if you use the JIRA PDF View Plugin.

if you want to export issue history data to PDF, it is just immediately available, along with all data in JIRA that is accessible for the current user.

see this, exported using the default template: sample PDF

Nancy Blackwell
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.
May 21, 2013

I agree that would be very nice, however we are running Jira 5.1..4 and we tried to install your plugin with dismal results. Your plugin doesn't come with the standard "manage Addons" ability until JIRA 5.2. Since we are not upgrading to JIRA until next year, this plugin is not a solution for us at this time.

0 votes
Xpand IT Support Team
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.
April 25, 2013

Hi Nancy,

We are sorry but currently we are not exporting any history/activity information. Your feature request has been registered and we will analyze it for a future release.

Best Regards

Suggest an answer

Log in or Sign up to answer