Example scripts
To homepage
Jira

Add user to project role
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
groovy
def myself = Users.getLoggedInUser()
def projectKey = 'TP'
def roleId = '10002'
def result = post("rest/api/3/project/${projectKey}/role/${roleId}")
.header('Content-Type', 'application/json')
.body([
"user": [myself.accountId]
])
.asObject(Map)
result.body
Having an issue with this script?
Report it here