How to log entire MAP so I can dissect it and find needed fields

Alexey Paveliev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 28, 2020

I struggle finding the right data within objects I receive

Can I logger.info whatever is in 

changelog (type: java.util.Map) or any other JSON object I receive?

The guessing is a source of frustration really.

If there is a better place that documents that please share.

Thanks! 

1 answer

1 accepted

1 vote
Answer accepted
Alexey Paveliev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 4, 2020

map method inspect() does the trick!

if you struggle to find what's in a map (changelog for example) 

logger.info (changelog.inspect()) will give you something like

['id':'10092', 'items':[['field':'priority', 'fieldtype':'jira', 'fieldId':'priority', 'from':'1', 'fromString':'Highest', 'to':'4', 'toString':'Low']]]

Just replace with whatever map you need to print out

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events