Skip to content
Discussion options

You must be logged in to vote

You can absolutely achieve something similar in fx! Here’s how you can rewrite your jq command using fx to extract and format multiple fields from a raw JIRA JSON response, including optional fields with defaults.

Assuming you’re using jira issue view ISSUE-12345 --raw | fx, here’s an fx expression that mimics your jq logic:

{
  key: this.key,
  summary: this.fields.summary,
  priority: this.fields.priority?.name,
  fixVersions: this.fields.fixVersions?.map(fv => fv.name) ?? ["develop"],
  parent: this.fields.parent?.key ?? ""
}

If you’re reading from stdin, the full command would be:

jira issue view ISSUE-12345 --raw | fx '({ key: this.key, summary: this.fields.summary, priority: this.…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by antonmedv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants