Script Console是运行一次性特别脚本以及学习和试验Jira API的地方。


如通script脚本,向一个问题写入备注。

import com.atlassian.jira.component.ComponentAccessor

//dispatch an event after creating the comment
final boolean dispatchEvent = true

// the body of the comment
final String commentBody = """The text for your comment, which can include specific values from the issue, such as the specific issue assignee ${issue.assignee?.name ?: 'Unassigned'}"""

// the author of the comment will be the logged in user
def author = ComponentAccessor.jiraAuthenticationContext.loggedInUser

ComponentAccessor.commentManager.create(issue, author, commentBody, dispatchEvent)



脚本的示例可以参照:

https://library.adaptavist.com/search?platforms%5B%5D=server&apps%5B%5D=ScriptRunner&features%5B%5D=Script%20Console&products%5B%5D=Jira