Update Reporter with Custom Field passed over via API

Steven Lees-Smith January 20, 2021

Hi there,

I am trying to come up with a way to update the reporter field with the value from a custom field.  The custom field is populated with the first and last name of the person who created the incident in Cherwell.  The reporter gets populated with a system name that the API uses when it creates the issue in Jira.

I have a manual automation task that fails all the time.

This is what I have in the Edit issue fields

{
"fields": {
"reporter": {"id": "customfield_10068"}
}

What should I have in order to replace reporter with the name value in the customfield.

 

thanks

 

1 answer

0 votes
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 20, 2021

Hi @Steven Lees-Smith ,

which type has your custom field with the first and last name? Is it a User Picker (you can select from users) or Text Field (only text information is stored)?

Steven Lees-Smith January 21, 2021

The custom field comes in as a text field as it is populated in Cherwell and passed over to Jira - the field in Cherwell is the Display Name so just a text field.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 21, 2021

Unfortunately, I don't think it is possible. Reporter field is working with user accounts and AFAIK you need to obtain the user's id, but you've got only text information about name.

Are these users, who you are trying to store, Jira users? Are you able to change the way, how the data about the user are stored to the Jira issue? If so, maybe you could be able to obtain information about the user's id using Jira's REST API and use it for setting the reporter.

Steven Lees-Smith January 21, 2021

yeh they are all Jira users and currently when the tickets are being checked to reassign the Reporter field is being manually altered to match the Cherwell name that is passed over via the API.

I have been ratting around the API to see if there was a way to identify the ID based on a matching 'display name' or the like but with no success.

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 22, 2021

Hi @Steven Lees-Smith ,

searching for user using REST API is available, see here. This is the basic endpoint and you should be able to send GET request like this (xxx can be display name of your user):

GET /rest/api/3/user/search?query=xxx

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events