Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to get the Reporter/Raise this request on behalf of field value in a REST Endpoint

Tomas Arguinzones Yahoo
Contributor
October 7, 2020

Hi,

I have a REST Endpoint that read from an external API to get values into jira service desk portal request fields based on the user submitting the request. It works fine for the most part since the reporter field is the current user logged in and submitting the request. So, this little piece of code I have in the REST Endpoint accomplish what I want:

ApplicationUser loggedInUser = ComponentAccessor.getJiraAuthenticationContext().loggedInUser

def email = loggedInUser.getEmailAddress()

 

However, when an agent is submitting a request thru the portal, they could potentially submit a request on behalf of another user, so how do I access the value of the "Raise this request on behalf of" field in the REST Endpoint?

 

Thank you in adavance!

 

 

1 answer

0 votes
PD Sheehan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 7, 2020

What is your link between the issue and the REST endpoint? How are you calling it?

It this something being called by a behaviour? Or in a post-function?

Wherever you have your issue object is where you'll need to get the reporter.

Then when calling the rest endpoint, you can include the reporter's details with the request data.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events