Hi,
I need to get the current user to change the scripted field's content by the current user's group. Some groups should see the raw version of data and some groups should see the calculated version.
I tried this code:
def response = get('/rest/api/2/myself').asObject(Map)
assert response.status == 200
def currentUsername = response.body.displayNameBut this response returns the script runner as a user and returns currentUsername as "ScriptRunner for Jira". Is there any other way to get the current user in scripted field.