...
Below, there is a sample code on how you can type your own script.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.user.ApplicationUser ApplicationUser currentUser = ComponentAccessor.getJiraAuthenticationContext().loggedInUser log.info("current user:" + currentUser.username) def reporter = issue.reporter.username log.info("reporter: " + reporter) return reporter.equals(currentUser.username) |
...
Headers code example;
Code Block | ||||
---|---|---|---|---|
| ||||
Accept=application/json |
Request body code example;
...
Code Block | ||||
---|---|---|---|---|
| ||||
assignee = $issue.assignee or {{issue.assignee}} reporter = {{issue.reporter}} date = $issue.created formattedDate = $DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format($issue.created) productName = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_11100')) price = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_11102')) displayName = $user.displayName userDisplayName = $ComponentAccessor.getUserManager().getUserByName("someUser").getDisplayName() // you can also use ComponentAccessor comment = $comment // this is the comment that is passed through the transition |
...