Hi,
I am having my own customers list made available in my JIRA instance. I like to have the customer name I selected as "Reporter" in my JSM issue.
I tried to apply smart value, but always I get "Anonymous" as value updated in my issue.
My Json
{
"fields": {
"reporter": { "value":"{{issue.customfield_10205.value}}"}
}
}
added screen shot, so you can point me what changes do I need to do.
Note: User I selected is part of the JIRA address book. Eventually I like to have reporter as Non JIRA user as they are outside of our org structure.
Hello @Suresh Srini
Does this concern a Service Management project?
How have you create your own customer list in Jira? What type of custom field is customfield_10205?
Yes. Currently this is for Service Management project.
customfield_10205 - is Elements connect display field.
I tried with hard coded values like "email id" & "login id" of the user. I always get the value as Anonymous.
If I know what kind of Json i can use and what kind of value does the reporter field accepts, I can try different methods to pull the data.
There are 2 help I need.
1- How to set value to reporters field & what type of value to be passed
2- How to use json to fetch vale from any other field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Suresh Srini
To set the Reporter field the JSON would be
{
"fields": {
"reporter": { "id":"{account id}" }
}
...where {account id} is replaced by the Atlassian Cloud User Account ID associated with the person you want to specify as the reported.
That means that whomever you want to make the Reporter has an Atlassian Cloud Account for which you can get the ID, and the person has permission to create items (as a customer) in your Service project.
What values/attributes are available to you from the custom field? You can use the guidance in the following document to get the JSON output from an existing issue where the field has been populated and see what attributes are available.
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
If the Atlassian Cloud User Account ID is not part of the data in the Elements field, then you would need to figure out a piece of information that is available that could be used in a REST API call to look up the user's Atlassian Cloud User Account and get the ID to use to then set the Reporter field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you. My environment is in Data center and not cloud.
{
"fields": {
"reporter": { "id":"{nnnnnnn}" }
}
I have person's Full name, email ID, Account short ID. I tried above, but got an error "Error while parsing additional fields. Not valid JSON." Tried with email ID as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI when I said that {account id} had to be replaced, that included replacing the curly braces vs. putting your value between the curly braces.
Apologies for missing your tags that show you are using Data Center.
The relevant documentation for Data Center is located here for Advanced Editing with JSON:
https://confluence.atlassian.com/automation103/advanced-field-editing-using-json-1488594924.html
There are examples under the heading "Using smart-values" for how the Assignee field can be set. The Reporter field is comparable.
The trick is figuring out how to reference the value from your Elements field. For that we need to know what attributes are available for that field.
For finding the details (values and attributes) for a custom field set in a Jira issue, the documentation is here:
https://confluence.atlassian.com/automation103/find-the-smart-value-for-a-field-1488594914.html
Can you use that to get an example of the information and structure available for your Elements field?
Is "Account short id" the same thing as the username in the user's profile in Jira? Do you have their full email address, matching the email address recorded in Jira for them?
If you have the equivalent of the username then the JSON would be something like this:
{
"fields": {
"reporter": { "name":something }
}
But the something needs to be replaced, and what it needs to be replaced with depends on the structure of the Elements field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tried the same and I am getting the same error. Invalid JSON.
FYI: I am trying to hardcode the value instead of using elements connect field data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your getting invalid JSON like because whatever you replaced something with was incorrect.
What did you actually try?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks for helping me here. Tried the ID for the person and also the email ID.
I tried 2 options:
option 1:
{
"fields": {
"reporter": { "name":nnnnnnn}
}
Option 2:
{
"fields": {
"reporter": { "name":nnnnnnn.nnnn@gmail.com}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First question, does the specified person have a User Account in your Jira instance?
Second question, if you go to one of these issues in the UI are you able to manually change the Reporter to the specified user?
Third question, when you say you used the "ID", does the value match the username shown in the user's profile in Jira?
If the answers to all the above are Yes, then this is the correct syntax:
{
"fields": {
"reporter": { "name":"username"}
}
}
You cannot set the Reporter field using a user's email address. You have to use their username or the unique numeric ID set for the user when their Jira account was created.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
fyi in DC users are generally (not always) associated by user keys, not usernames
reporters, assignees, comment authors, should all require user keys
When Atlassian state "name" in parameters, what they really mean is user key, 99% of the time.
Invalid json would be trying to provide "nnnn" without quotes indicating it's a hardcoded/string value. Whatever is taking that json for processing sees a value without quotes as an object, not as a text value. A json of {"something": 2} means 2 as a number. {"something": "2"} means 2 as text value. {"something": whatever} is invalid because whatever is treated as an object which it cannot resolve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I disagree that in this would be invalid JSON:
"reporter": {"name": some_name}
As it stands it is not technically invalid JSON. But it would not get the desired result of setting the field to the user.
I don't agree that in this case "name" means key. For a user picker field there is a separate attribute named "key" and it would require a different value.
I believe the invalid JSON error was caused by a missing closing }. While it may have been a paste error from @Suresh Srini , in their last example of what they tried the final } is missing, which would have been the cause of the invalid JSON error if what they showed is exactly what they tried.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you.
nnnn OR nnnn.nn@gmail.com is the actual user registered in my environment.
Yes. I can change the reporter to the issue with this user ID. Below is the error even after having closing }. When I say login ID OR JIRA ID,
Error while parsing additional fields. Not valid JSON.
{
"fields": {
"reporter": { "name":nnarayan}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to put double quotes around nnnnnn
{
"fields": {
"reporter":{"name":"nnnnnn"}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a ton, it worked. Really appreciate it.
Following question:
I understand we need to have the person to be available in JIRA instance.
Since this is Service management and when I open the form in Portal ( where we allow customers from outside how is not part of JIRA instance as well), can we add them into customs list in service management project and use them here as reporter?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your service portal are you allowing users to open requests anonymously, or are you requiring them to create an account?
What is your full automation rule?
There is an Add New Service Management Customer action available in Automation Rules, so if you have the email address and a name for the user you should be able to create an account for them if they don't already have one. Exactly how to include that in your automation rule depends on the structure of your rule currently.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, since you have solved the original problem from your post with the responses I provided, please consider clicking the Accept Answer button above the response thread.
That will mark your Question as Solved. That helps others searching the community find the questions with validated answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you.
I accepted the answer and will open the new thread once I have more info on the portal side changes.
appreciate your time and effort. Kudos to you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.