Changes for page JIRA Integration
Last modified by Vincent Massol on 2021/03/18 11:28
To version 18.1
edited by Vincent Massol
on 2017/07/18 17:05
on 2017/07/18 17:05
Change comment:
There is no comment for this version
Summary
-
Objects (1 modified, 0 added, 0 removed)
Details
- ExtensionCode.ExtensionClass[0]
-
- Description
-
... ... @@ -43,3 +43,24 @@ 43 43 Result: 44 44 45 45 {{image reference="issuelist.png"/}} 46 + 47 +=== Computes total time spent ==== 48 + 49 +{{code language="java"}} 50 +{{groovy}} 51 +import groovy.json.* 52 + 53 +def jql = "project = NUMPORTAL AND component = 17-002 AND component = 'Out of Scope'" 54 +def url = "https://jira.xwikisas.com/rest/api/2/search?jql=${java.net.URLEncoder.encode(jql)}&os_username=<usernamehere>&os_password=<userpasswordhere>&os_authType=basic&field=timespent".toURL().text 55 +def root = new JsonSlurper().parseText(url) 56 + 57 +int totalTimespent = 0 58 +root.issues.each() { issue -> 59 + def spent = issue.fields.timespent 60 + if (spent) { 61 + totalTimespent += spent 62 + } 63 +} 64 +println "Total time spent = ${totalTimespent} seconds" 65 +{{/groovy}} 66 +{{/code}}