Get Assignee using Forge

I would like to get the name of assignee of an issue.
I define a variable assignee as event.issue.fields.assignee but it doesn’t work.
Is there any other way to get it?

Hi @hirokinishimaki,

There are different ways to get the issue assignee depending on where you want to get it. For example, if you want to get it from a product event (which seems to be the case), you can get the accountId via event.issue.fields.assignee.accountId and then call the Get user REST API passing the accountId. You can get the name in the response.

If you have a reference to the issue ID or key, another option is to invoke the Get issue REST API.

Kindly share your code snippet and use case so that we’ll have better context.

Cheers,
Ian

2 Likes

Thank you for the reply!
I tried and I could get it.

1 Like

Happy to help, @hirokinishimaki.

Feel free to share the approach you took in order to help guide other developers who are facing a similar scenario.

Cheers,
Ian

I take the return value of requsetJira from userId and use userInfo to get username.

1 Like