Let's assume you have saved payload received using Jira REST API to file jiraTask.json
.
$ jiraGet issue/BOOM-666 > jiraIssue.json
You can read more about Super-simple Jira API in
Super-simple Jira API wrapper for bash/zsh
andriy melnyk ╔╬╚╗╠ ╠╣╔╦╣╚╗╔╬╗ ・ Aug 2 '19 ・ 2 min read
#jira #bash #zsh
Then you can list non-empty fields of the ticket using the folowing command (make sure you have installed jq before):
$ jq --raw-output '
.fields |
. as $f |
keys[] |
select($f[.] != null)
' jiraIssue.json
...<87 fields listed>...
In my example, the command above lists 87 non-empty fields of Jira ticket. Compare it with total number of fields in the ticket which is 983 😱
Or, if you want to see fields with their values, use the following:
$ jq --raw-output '
.fields |
. as $f | [
keys[] |
select($f[.] != null) |
{ (.): $f[.] }
] |
add
' jiraIssue.json
Top comments (0)