Work with Comments
With HAPI, you can easily add comments to issues and retrieve comments from issues.
Add comments to an issue
You can add comments to an issue in Jira to provide updates, share progress, or communicate important information. Here's an example of how to add a comment:
groovyissue.addComment('Comment for administrators')
Retrieve All Comments from an Issue
You can use the getComments
function to fetch all comments associated with an issue.
groovydef issue = Issues.getByKey('JRA-1') issue.getComments() // To retrieve specific properties of comments, such as the body, you can use: issue.getComments().collect { it.body }