Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Getting 'Reporter field is required' error when creating Jira issue from service now via REST call Edited

I am creating jira issue from Service now via REST call which was working until yesterday

Suddenly i am getting 'Reporter' is mandatory error.

The user is having permission to modify the Reported for field and create jira issue.

When I make 'reporter' an option field, it is working. But when it is Required, It is not working.

Can anyone provide solution for this?

5 answers

1 accepted

0 votes
Answer accepted
DPK J Community Leader Feb 18, 2020

@Kanhaiya Panigrahi  if a field is required you need to pass some value to it, otherwise API will surely give error.

@DPK J 

{
"fields":{
"issuetype":{
"name":"Bug"
},
"project":{
"key":"SNOW"
},
"summary":"Issue with creating Jira tickets from ITWorx",
"description":" Issue with creating Jira tickets from ITWorx",
"priority":{
"name":"Low"
},
"customfield_10400":"INC0348345",
"customfield_10401":"https://ptc.service-now.com/incident.do?sys_id=1868e1251343cc100a083ff18144b0d9",
"reporter":{
"name":"Jira User"
}
}
}

Like Tejesh Chandra K H likes this

And until yesterday it was working but suddenly it stopped.

I tried with id, name and email too for the reporter but its not working.

DPK J Community Leader Feb 18, 2020

@Kanhaiya Panigrahi  Can you give a copy of exact error message in API response?

Ideally this should work, of field is part create screen in your Jira.

{
"fields": {
...
"reporter": {
"id": <ID_OF_REPORTER>
},
...
}

}

@DPK J The Key id is not accepted by Jira. Instead of that I tried with email & name.

But its giving me the same error.

{"errorMessages":[],"errors":{"reporter":"Reporter is required."}}

When I made reporter field optional, then Its working but even though the reporter field is not accepting the value, it remains Anonymous.

DPK J Community Leader Feb 19, 2020

@Kanhaiya Panigrahi  and @Marcin_Kujawa 

I am not sure what is wrong in your site, after

  • Making reporter field required,
  • Adding it to appropriate screen (issue create screen for project/issue type)
  • Assigning `Project Role` permission to 'Modify Reporter'

I was able to make a rest request using CURL, and it worked perfectly fine. Here is sample of that curl request,

curl --request POST \
--url '<SITE_URL>/rest/api/3/issue' \
--user '<EMAIL>:<API_TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fields": {
"project": {
"key": "SP"
},
"summary": "Issue with reporter test #1",
"issuetype": {
"name": "Task"
},
"reporter": {
"id": "<USER_ID>"
},
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"text": "description",
"type": "text"
}
]
}
]
}
}
}'
Like Kanhaiya Panigrahi likes this

@DPK J Now its working for me. Thanks for the solution. 

Earlier I thought By ID it measn name before @domainName

But currently I just passed id of the user which I picked from the URL.

{
"fields":{
"issuetype":{
"name":"Bug"
},
"project":{
"key":"SNOW"
},
"summary":"Issue with creating Jira tickets from ITWorx2",
"description":" Issue with creating Jira tickets from ITWorx2",
"priority":{
"name":"Low"
},
"customfield_10400":"INC0348345",
"customfield_10401":"https://ptc.service-now.com/incident.do?sys_id=1868e1251343cc100a083ff18144b0d9",
"reporter":{
"id":"59f6fdf0883e38789b8e1e8f"
}
}
}

We've had the same issue this week ourselves. We've currently also worked around it by hardcoding an ID but defeats the point of the field.

It has been working for months up until now.

Has something changed in Jira in relation to the Reporter field?

DPK J Community Leader Feb 23, 2020

@Tom Boyle  Yes, GDPR has started kicking in for API's. So using ID field of user is best bet at this time.

Like Tom Boyle likes this

how can we user name instead of id to set reporter field is there nay way

Like Agustin Barreto likes this

Why the hell they have did this change!!!, this has broken my integration, and is IMHO a very bad option when you need to integrate different systems.

I have the same problem. Reporter field has value (username), but I receive 'Repoter is required' exception.

I set Reporter as an optional field and it worked, but it's just workaround, not solution.

Like # people like this

@Marcin_Kujawa Thanks for the solution. I have already tried this yesterday and yes it is just a workaround not a permanent solution.

If you find anything permanent solution please post it here too.

Meanwhile I am also investigating & if i get it then will post.

Like Marcin_Kujawa likes this

@Marcin_Kujawa You can pass the userid, just open the user's profile in JIRA & pick it from the URL. 

{
"fields":{
"issuetype":{
"name":"Bug"
},
"project":{
"key":"SNOW"
},
"summary":"Issue with creating Jira tickets from ITWorx2",
"description":" Issue with creating Jira tickets from ITWorx2",
"priority":{
"name":"Low"
},
"customfield_10400":"INC0348345",
"customfield_10401":"https://ptc.service-now.com/incident.do?sys_id=1868e1251343cc100a083ff18144b0d9",
"reporter":{
"id":"59f6fdf0883e38789b8e1e8f"
}
}
}

Thank you. Maybe it works, but I'm using Atlassian.Jira (.NET nuget package). I have only 'Reporter' field, no Id subfield within it. It seems I have to wait form new version of that library.

Like Deepthi_Posimsetty likes this

@Marcin_Kujawa Even I didn't find anything with fieldname 'id'

But If you are able to search the user in people section then open user's profile

then from URL you can pick the id

https://ptc-it.atlassian.net/jira/people/59f6fdf0883e38789b8e1e8f 

@Kanhaiya Panigrahi The problem mentioned before, and that I have, is that the Reporter / name subfield is required but Jira refuses to accept any value for 'name'.

I had to make Reporter optional to be able to create new issues.  When I retrieve the issue data, the Reporter data is null.  If I set a Reporter in Jira UI, and then retrieve the issue again, the Reporter data does not contain a 'name' sub-field.

 "created": "2020-03-24T10:00:05.000Z",
"reporter": {
"self": "https://xxx.atlassian.net/rest/api/2/user?accountId=5a964372b81cd2381486a5de",
"emailAddress": "ixxx@gmail.com",
"avatarUrls": {
"48x48": "https://secure.gravatar.com/avatar/1f44eeb2d6cbf38e55721f57f5a72022?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FIL-5.png&size=48&s=48",
"24x24": "https://secure.gravatar.com/avatar/1f44eeb2d6cbf38e55721f57f5a72022?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FIL-5.png&size=24&s=24",
"16x16": "https://secure.gravatar.com/avatar/1f44eeb2d6cbf38e55721f57f5a72022?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FIL-5.png&size=16&s=16",
"32x32": "https://secure.gravatar.com/avatar/1f44eeb2d6cbf38e55721f57f5a72022?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FIL-5.png&size=32&s=32"
},
"displayName": "Joe Bloggs",
"active": true,
"timeZone": "Europe/London",
"accountId": "5a964372b81cd2381486a5de",
"accountType": "atlassian"
},

Actually it contain 'id' as a sub field instead of name now.

I highlighted the same below. you can try with this. In the value just pass user's sys id which yo will get from the URL of user's profile.

{
"fields":{
"issuetype":{
"name":"Bug"
},
"project":{
"key":"SNOW"
},
"summary":"Issue with creating Jira tickets from ITWorx2",
"description":" Issue with creating Jira tickets from ITWorx2",
"priority":{
"name":"Low"
},
"customfield_10400":"INC0348345",
"customfield_10401":"https://ptc.service-now.com/incident.do?sys_id=1868e1251343cc100a083ff18144b0d9",
"reporter":{
"id":"59f6fdf0883e38789b8e1e8f"
}
}
}

Like Ian Larner likes this

Hi
i have similar issues though just in Powershell

Script

$parameters = @{
Project = 'INF'
#customfield_10930 = 'INF-2312'
issueType = 'Task'
Reporter ='kim.kokholm'
Summary = 'Test issue from PowerShell'
Description = "This is a sample issue created by ." }

New-JiraIssue @parameters

error

Invoke-JiraMethod :
reporter
--------
Reporter is required.
At C:\Program Files\WindowsPowerShell\Modules\JiraPS\2.12.5\JiraPS.psm1:3842 char:27
+ if ($result = Invoke-JiraMethod @parameter) {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:) [Invoke-JiraMethod], RuntimeException
+ FullyQualifiedErrorId : InvalidResponse.Status400,Invoke-JiraMethod


Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you