JIRA Integration: Work Logs

The time logged in a specific issue can be retrieved from JIRA by using the JIRA API (getWorklogs). The result returned will include the details of the time logged into an issue. For example:

 

<multiRef id=”id1″ soapenc:root=”0″ soapenv:encodingStyle=”https://schemas.xmlsoap.org/soap/encoding/” xsi:type=”ns3:RemoteWorklogImpl” xmlns:soapenc=”https://schemas.xmlsoap.org/soap/encoding/” xmlns:ns3=”https://service.soap.rpc.jira.atlassian.com”>
<author xsi:type=”xsd:string”>hmkhong</author>
<comment xsi:type=”xsd:string”/>
<created xsi:type=”xsd:dateTime”>2011-10-12T06:22:18.663Z</created>
<groupLevel xsi:type=”xsd:string” xsi:nil=”true”/>
<id xsi:type=”xsd:string”>10002</id>
<roleLevelId xsi:type=”xsd:string” xsi:nil=”true”/>
<startDate xsi:type=”xsd:dateTime”>2011-10-12T06:22:00.000Z</startDate>
<timeSpent xsi:type=”xsd:string”>2 hours</timeSpent>
<timeSpentInSeconds xsi:type=”xsd:long”>7200</timeSpentInSeconds>

<updateAuthor xsi:type=”xsd:string”>hmkhong</updateAuthor>
<updated xsi:type=”xsd:dateTime”>2011-10-12T06:22:18.663Z</updated>
</multiRef>

 

If you find the “pretty” format too difficult to calculate, you can use the timeSpentInSeconds. This field will returned time logged in seconds.