guilhemmarchand / TA-jira-service-desk-simple-addon

Atlasian JIRA add-on for Splunk alert actions
11 stars 8 forks source link

Jira Dashboard - Open Issues #28

Closed hackforfood-uk closed 4 years ago

hackforfood-uk commented 4 years ago

Love the addon!

If possible would be really handy for us to be able to pull the number of open issues from Jira by Type to display them in dashboards in Splunk which is our main monitoring tool. :-)

guilhemmarchand commented 4 years ago

Hi @petegriggs !

Thank you, I will keep track of this request and consider it for further updates of the Add-on.

Kind regards,

Guilhem

zerodago commented 4 years ago

Hi, +1 love users 👍 and i also join to request a dashboard

Similar to app 1770 :-)

Thanks

Diego

guilhemmarchand commented 4 years ago

@zerodago Thanks ;) Understood, I am planing to start working on this soon enough.

Guilhem

zerodago commented 4 years ago

Great!! more idea... app 4178 :)

guilhemmarchand commented 4 years ago

Hi, @petegriggs @zerodago

A new custom command is now part of the Add-on in version 1.0.19 live in Splunk Base, this custom command allows you to work with JIRA REST API and specify the endpoint to deal with, which supports as well using JIRA JQL language.

Using the REST wrapper, you can now easily query JIRA in any simple or advanced ways, a builtin dashboard is provided to demonstrate its usage and as well a report that generates the JIRA issues statistics usage per project and status categories, that can be used to index as summary events or in the metrics store.

Rewiew: https://ta-jira-service-desk-simple-addon.readthedocs.io/en/latest/userguide.html#jira-rest-api-get-wrapper

Let me know if you have any remarks, comments for future enhancements, if so please open a new issue in GitHub with your requirements.

Guilhem

guilhemmarchand commented 4 years ago

Note: re-opening this issue to keep track of the original query, working on providing valuable analytic reporting for JIRA using JQL and the REST wrapper introduced today, very promising.

zerodago commented 4 years ago

thanks very much, I will test this new functionality. Diego

guilhemmarchand commented 4 years ago

@zerodago Thanks, currently I am exploring up to what kind of feature we can go with JQL over REST or REST only queries.

There is a certain of things that can be done but I am unsure yet how much can be done, for ex:

<dashboard theme="dark">
  <label>JIRA Analytic - Global Overview</label>
  <search id="base_get_projects">
    <query>| jirarest target="rest/api/2/project" | spath | rename "{}.key" as key | table key | rename key as projects | eval projects_csv=mvjoin(projects, ",")</query>
    <progress>
      <condition>
        <set token="tk_csv_projects">$result.projects_csv$</set>
      </condition>
    </progress>
  </search>
  <search id="base_projects_stats" depends="$tk_csv_projects$">
    <query>| makeresults | eval projects_csv="$tk_csv_projects$" | makemv delim="," projects_csv | rename projects_csv as key | mvexpand key | streamstats count as project_no

| map [ | jirarest target="rest/api/2/search?jql=project=$$key$$&amp;maxResults=0" ] | streamstats count as result_no | rex field=_raw "\"total\":\s(?&lt;total_issues&gt;\d*)"
| append [ 
| makeresults | eval projects_csv="$tk_csv_projects$" | makemv delim="," projects_csv | rename projects_csv as key | mvexpand key | streamstats count as project_no
| map [ | jirarest target="rest/api/2/search?jql=project=$$key$$%20AND%20statuscategory%20IN%20%28%22Done%22%29&amp;maxResults=0" ] | streamstats count as result_no | rex field=_raw "\"total\":\s(?&lt;total_done&gt;\d*)"
]
| append [ 
| makeresults | eval projects_csv="$tk_csv_projects$" | makemv delim="," projects_csv | rename projects_csv as key | mvexpand key | streamstats count as project_no
| map [ | jirarest target="rest/api/2/search?jql=project=$$key$$%20AND%20statuscategory%20IN%20%28%22To%20Do%22%29&amp;maxResults=0" ] | streamstats count as result_no | rex field=_raw "\"total\":\s(?&lt;total_to_do&gt;\d*)"
]
| append [ 
| makeresults | eval projects_csv="$tk_csv_projects$" | makemv delim="," projects_csv | rename projects_csv as key | mvexpand key | streamstats count as project_no
| map [ | jirarest target="rest/api/2/search?jql=project=$$key$$%20AND%20statuscategory%20IN%20%28%22In%20Progress%22%29&amp;maxResults=0" ] | streamstats count as result_no | rex field=_raw "\"total\":\s(?&lt;total_in_progress&gt;\d*)"
]
| append [ | makeresults | eval projects_csv="$tk_csv_projects$" | makemv delim="," projects_csv | rename projects_csv as key | mvexpand key | streamstats count as project_no ]
| eval line_merge=case(isnum(project_no), project_no, isnum(result_no), result_no)
| stats first(key) as project, first(total_*) as "total_*" by line_merge | fields - line_merge

| appendpipe [ stats sum(total_done) as total_done, sum(total_in_progress) as total_in_progress, sum(total_issues) as total_issues, sum(total_to_do) as total_to_do ]
| fillnull value="TOTAL" project

| eval pct_total_done="% " . round(total_done/total_issues*100, 2), pct_total_to_do="% " . round(total_to_do/total_issues*100, 2), pct_total_in_progress="% " . round(total_in_progress/total_issues*100, 2)
| foreach pct_* [ eval &lt;&lt;FIELD&gt;&gt; = if(isnull('&lt;&lt;FIELD&gt;&gt;'), "% 0.00", '&lt;&lt;FIELD&gt;&gt;' ) ]

| eval _time=now() | fields _time, project, pct_*, total_*</query>
  </search>
  <row>
    <panel depends="$alwaysHideCSS$">
      <html>
        <style>
          #ChartGeneral{
            width:30% !important;
          }
          #TableGeneral{
            width:70% !important;
          }
        </style>
      </html>
    </panel>
    <panel>
      <single>
        <search base="base_get_projects">
          <query>stats dc(projects) as dcount</query>
        </search>
        <option name="colorMode">none</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x006d9c","0x006d9c"]</option>
        <option name="rangeValues">[0]</option>
        <option name="underLabel">PROJECTS</option>
        <option name="useColors">1</option>
      </single>
    </panel>
    <panel>
      <single>
        <search base="base_projects_stats">
          <query>where project="TOTAL" | fields total_issues</query>
        </search>
        <option name="colorMode">none</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x006d9c","0x006d9c"]</option>
        <option name="rangeValues">[0]</option>
        <option name="underLabel">TOTAL NUMBER OF ISSUES</option>
        <option name="useColors">1</option>
      </single>
    </panel>
    <panel>
      <single>
        <search base="base_projects_stats">
          <query>where project="TOTAL" | fields total_to_do</query>
        </search>
        <option name="colorMode">none</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x006d9c","0x006d9c"]</option>
        <option name="rangeValues">[0]</option>
        <option name="underLabel">TOTAL ISSUES IN STATUS TO DO</option>
        <option name="useColors">1</option>
      </single>
    </panel>
    <panel>
      <single>
        <search base="base_projects_stats">
          <query>where project="TOTAL" | fields total_in_progress</query>
        </search>
        <option name="colorMode">none</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x006d9c","0x006d9c"]</option>
        <option name="rangeValues">[0]</option>
        <option name="underLabel">TOTAL ISSUES IN STATUS IN PROGRESS</option>
        <option name="useColors">1</option>
      </single>
    </panel>
    <panel>
      <single>
        <search base="base_projects_stats">
          <query>where project="TOTAL" | fields total_done</query>
        </search>
        <option name="colorMode">none</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x006d9c","0x006d9c"]</option>
        <option name="rangeValues">[0]</option>
        <option name="underLabel">TOTAL ISSUES IN STATUS DONE</option>
        <option name="useColors">1</option>
      </single>
    </panel>
  </row>
  <row>
    <panel id="ChartGeneral">
      <chart>
        <search base="base_projects_stats">
          <query>| where project="TOTAL" | fields - _time | fields total_to_do total_in_progress total_done | rename total_to_do as "To Do", total_in_progress as "In Progress", total_done as "Done" | transpose | rename column as "status category", "row 1" as "number of issues"</query>
        </search>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">none</option>
        <option name="height">600</option>
      </chart>
    </panel>
    <panel id="TableGeneral">
      <table>
        <search base="base_projects_stats">
          <query>fields - _time | rename project as Project, pct_total_done as "% Done", pct_total_in_progress as "% In Progress", pct_total_to_do as "% To Do", total_done as "# Done", total_in_progress as "# In Progress", total_issues as "# Total", total_to_do as "# To Do"</query>
        </search>
        <option name="count">30</option>
        <option name="drilldown">row</option>
      </table>
    </panel>
  </row>
</dashboard>

image

The other option is indexing issues (there's an app for that already), while REST/JQL provides no discrependancy results in live which is nice too

zerodago commented 4 years ago

Excelent! I am planning a new dashboard (taking app ideas from app servicenow and cherwell). I promise to share it

(I'm Diego Rodriguez, We were exchanging mail from my work-mail for installation issues with Jira server)

guilhemmarchand commented 4 years ago

Thanks @zerodago (Diego ;-) Sure I remember!

Feel free yes, thank you

guilhemmarchand commented 4 years ago

Notes: A first version of this dashboard using the jirarest command and JQL queries is provided in release 1.2.21

guilhemmarchand commented 4 years ago

@zerodago A first version of the dashboard was integrated with the current release of the Add-on, hence closing this issue.