Hello Experts,
I am trying to set sub-task ''Initiative Key'' from its parent by using below JSON automation. But I am receiving error '(Operation value must be a string (customfield_21602))'. Could anyone please help me on this.
Below is the JSON query used in automation rule:
{
"fields": {
"customfield_21602": { "value": "{{triggerissue.parent.customfield_21602.value.asJsonString}}" }
}
}
Hi @hshivanna -- Welcome to the Atlassian Community!
When a rule references smart values through the associated issues, such as with {{issue.parent.customfield_12345}} or {{issue.subtasks.customfield_12345}} most of the data is not loaded. Instead, only a subset of the fields are available, such as: key, summary, assignee, status, etc.
If the associated issues loaded all of their data, you could imagine a scenario where an entire tree of issues would be pulled in, ever increasing in number / size. Worse still, there could be cross-linkages leading to loops.
When you need to access the other fields in the parent or subtasks, please use either branching or the Lookup Issues action with JQL to fully load all of the fields for the issue.
And for Jira Data Center, Lookup Issues will only load some fields, not including custom fields. The workaround for that situation is to use branching or use the Send Web Request action to load the data with the REST API issue search with JQL.
Kind regards,
Bill
Hello @hshivanna
Welcome to the Atlassian community.
What is the field type of customfield_21602?
I see that you are trying to set this field from data in the same field in another issue. In JSON you should be able to use this rather than "value":
"customfield_21602" : "{{triggerIssue.parent.customfield_21602}}"
Have you tried that?
Are you trying to use this JSON code in an Edit Issue action? If so, are you not able to select the field you want to edit from the Choose fields to set list? If you can, then you should be able to use the COPY option to then copy data from the same field in the issue's parent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Trudy,
Thank You for the reply.
When i tried with first option, i see below error :(
(No issue with the key: {id=********, key=***********, , name=Initiative, subtask=false, avatarId=12606}}} (customfield_21602))
I would like to pass key=*********** as the Initiative key value.
I dont have initiative key available in edit field dropdown. Hence trying with advanced field option.
***********
***********
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional information.
What is the field type of customfield_21602?
Can you provide screen images that show your entire rule? Sometime errors occur due to the context of the step within the rule.
Can you show us a screen image of all the output of the rule execution log, including the section on the right where it shows the issue keys for issues referenced during the rule execution?
Are you able to access issue AHPCOM-5395 directly?
What is the Project Scope of the rule, from the Rule Details page? Who is specified as the Actor for the rule?
You are trying to access information from the issue that triggered the rule. What type of issue triggered the rule? Was it a subtask, or a standard level issue that has a parent Epic?
Can you show us a screen image of the issue that triggered this rule, showing us the value in customfield_21602 and showing us the breadcrumbs at the top of the issue that show the issue key and the issue key of its parent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Trudy,
Thank You!Please find the answers inline:
What is the field type of customfield_21602? This is something i am unable to figure out from JIRA
Can you provide screen images that show your entire rule? Sometime errors occur due to the context of the step within the rule. I have attached Automation Rule Screenshot
Can you show us a screen image of all the output of the rule execution log, including the section on the right where it shows the issue keys for issues referenced during the rule execution? I have attached audit log screenshot
Are you able to access issue AHPCOM-5395 directly? - Yes, I can
What is the Project Scope of the rule, from the Rule Details page? Who is specified as the Actor for the rule? - To have Intiative KEY added to Sub-task
You are trying to access information from the issue that triggered the rule. What type of issue triggered the rule? Was it a subtask, or a standard level issue that has a parent Epic? - It is a sub task
Can you show us a screen image of the issue that triggered this rule, showing us the value in customfield_21602 and showing us the breadcrumbs at the top of the issue that show the issue key and the issue key of its parent. -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional information.
Based on the images you provided the graphics in your Automation Rule indicate you are using Jira Server or Jira Data Center. Can you click on your Help icon in the upper right corner, then select About Jira, and tell us what version information is shown there?
What is the field type of customfield_21602? This is something i am unable to figure out from JIRA
From the image you provided the field appears to be a selection list field that lets you select an issue. The Jira Data Center versions I work with current (9.x.x) don't support that type of custom field natively. Perhaps it came from a plugin that was added to your instance. Your Jira Administrators would be able to get the field type information from the Custom Fields screen.
What is the Project Scope of the rule, from the Rule Details page? Who is specified as the Actor for the rule? - To have Intiative KEY added to Sub-task
What I am looking for here is the Scope and Projects and Actor field information from the Rule Details page. Example: (Actor appears on the right farther down on the screen).
In the above are you specified as the Actor, or is some other user specified as the Actor?
In the sub-task can you manually select the specified issue? That is just a test to confirm that there is nothing in the field definition that blocks its selection.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional information.
Can you please tell us what the Scope of the rule is?
What I am looking for here is the Scope and Projects field information from the Rule Details page. Example:
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.
I do not have an environment that has an Issue Picker custom field plugin like yours where I can execute tests for this specific scenario. Can you ask your Jira Administrators what plugin is providing you with that field and share that information?
Without that, my educated guess is that the Scope of your rule must include both projects in order for it to be able to get that issue key that references a different project. Multiple-project scoped rules can be managed only by Jira Administrators, so you would need their help to change your rule in that manner.
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.