extracting fields from a Jira “issue” (like a very nice and useful description)? how to get the markup source of the issue description?

No, Jira does not let you read (“per se“) the markup source of an “issue” – that’s why I went this way in the first place  🙄

jq . X.json > X.pretty.json
jq -c 'path(..)|[.[]|tostring]|join("/")|"."+.' X.pretty.json
  • the field we are interested in is fields/description
jq ".fields.description" X.json > X.description.txt
  • save the value of that field to a separate file!
  • remove the leading and trailing double-quotes!
  • replace all \" with ordinary double-quotes!
  • remove \r!
  • replace \n with ordinary new-lines!
jq ".fields.description" X.json | 
perl -pe 's/^"(.*)"$/$1/; s/\\"/"/g; s/\\r//g; s/\\n/\n/g' > X.description.txt
  • looks good, doesn’t it?

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.