I am creating a task using ScriptRunner for Jira. I want the reporter information of this task to be the person triggering this process, but I should do this while keeping the 'ScriptRunner Add-On User' in the 'Run As' section. I do not want the 'Initiating User'. The script I use for this is as follows. I am looking forward to your assistance on this matter.
def issueKey = issue.key
def currentUser = get('/rest/api/2/myself').asObject(Map)
assert currentUser.status == 200
def newReporter = currentUser.body.accountId
logger.info("newReporter: "+ newReporter)
put("/rest/api/3/issue/${issueKey}")
.queryString("overrideScreenSecurity", Boolean.TRUE)
.queryString("overrideEditableFlag", true)
.header('Content-Type', 'application/json')
.body(
fields:
[
reporter: [
accountId: newReporter
],
]
)
.asString()
You are correct, it does not log them in any way.
Same for edits and deletes of comments - original text is gone forever (although you do get an email saying "was X, changed to Y" on comment edits)
If you weren't using OnDemand, I'd point at the auditor plugin which does log these events, alongside most of your administration actions. With OnDemand, your only real option is to remove permissions for users to do these things.
And also, to prevent the deletion of worklogs, protect them using permissions and allow may only project admins to delete/edit the worklogs.
https://confluence.atlassian.com/display/JIRA/Managing+Project+Permissions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.