/** This example script console script shows how to get a user based on a specified account Id.* "All right, title and interest in this code snippet shall remain the exclusive intellectual property of Adaptavist Group Ltd and its affiliates. Customers with a valid ScriptRunner* license shall be granted a non-exclusive, non-transferable, freely revocable right to use this code snippet only within their own instance of Atlassian products. This licensing notice cannot be removed or* amended and must be included in any circumstances where the code snippet is shared by You or a third party."*/// The username to search fordefaccountID='<accountIdHere>'// return the user specifieddefresult=get('/rest/api/2/user/').header('Content-Type','application/json').queryString("accountId",accountID).asObject(Map)// If the user is found return the details for the userif(result.status==200){return"The user with the accountId of ${accountID} has the displayName of ${result.body.displayName}"}else{return"Failed to find user with the name of ${userName} : Status: ${result.status} ${result.body}"}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.