An Handler that parses an xls mail attachment, producing issues
| Name | Excel POP Parser Handler |
|---|---|
| Version | 1.1 |
| Author(s) | Marcello Braucci |
| Home Page | http://www.pronetics.it |
| Download Location | src |
Description/Features
This handler uses POI to parse an xls file. The file is interpreted using a template, that with an xml-like sintax, binds the xls fields to issue fields.
Install
- Edit the file com\pronetics\jira\services\messagehandlers\messages.properties in the jar pronetics-excel-pop-service-1.1.jar. Here you must set some parameters.
mime.type application/vnd.ms-excel
templates.dir The directory where your templates resides
issue.type.error If something goes wrong, the handler registers an error into jira. Specify here the issueTypeId that you want to map the error with.
project.id.error The project id for the error issue.
default.user The issues will be reported by this user
- Copy the jar and the poi lib file in the WEB-INF/lib directory
- Stop jira
- edit the file WEB-INF\classes\services\com\atlassian\jira\service\services\pop\popservice.xml adding the following lines:
<value> <key>com.pronetics.jira.services.messagehandlers.CreateIssueFromXlsHandler</key> <value>Create Issue From Excel Handler</value> </value>
under the values of the property handler.
- Start Jira
- Create a new service with class com.atlassian.jira.service.services.pop.PopService, using this new handler.
In the handler-params field, you must specify some configuration parameters. In the next version, all those parameters will be assigned in the <issue> template tag.
- defaultSummary: The summary. You can put template tags here.
- defaultPriorityId: the priority id
- defaultStatusId: the status id
Manual
The received file is checked against a template directory. If a file with the same name exists, the file is parsed. The template itself is an xls file. If you look at the example, you find all the sintax you need for figuring out your use case.
Template Syntax
- <issue project="projectName" type="issueTypeName"></issue>
Each row find from this block, will be considered to contain an issue. The issue will be recorded in project projectName and will be of type issueTypeName. - <issue-custom-field name="customFieldName"/>
This column will be bind to an issue custom field named customFieldName - <issue-field name="issueFieldName"/>
This column will be bind to an issue field named issueFieldName

Comments (2)
Nov 22, 2007
mameha says:
I tried to use this but it didnt work. It is not clear what format the data fil...I tried to use this but it didnt work.
It is not clear what format the data file should be (ie. does it include header row or not? does it have blank column at start and end or not?).
I made 6 variants of the data file and managed to get this to recognise 3 of them, however each time it throws a 'cannot create issue' error in the log. The other 3 files it totally ignores without throwing any errors.
Can anyone confirm that this actually works?
Nov 29, 2007
mameha says:
I gave up on this. Unless anyone can provide better documentation, I sugge...I gave up on this. Unless anyone can provide better documentation, I suggest you to use PHP to parse the excel file and convert to issues by using cURL:
$url = "http://www.server.com/jira/secure/CreateIssueDetails.jspa?pid=10140&reporter=auto-import"; // the parameters should be built from your excel file by parsing it with fopen etc.
// see http://confluence.atlassian.com/display/JIRACOM/Automating+JIRA+operations+via+wget for more about the parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);