2 answers
- 10-1
I believe I have this under control.
my sync is configured as such (basically):
if (issuetype == "bug") { ... update bug specific fields } else if (issuetype == "epic") { ... update epic specific fields def epicStatusValue = replica.customFields."Epic Status".value.value issue.customFields."Epic Status".value = nodeHelper.getOption(issue, "Epic Status", epicStatusValue) } else if (issuetype == "story") { ... update story specific fields } else if (issuetype == "task") { ... update task specific fields } Epic.receive()
Then, per the exalate documentation, I added Epic.receive() to the end if the imcoming sync
(see this documentation: https://docs.idalko.com/exalate/display/ED/How+to+sync+epics+in+Jira+Cloud)
When I do that, I get the error initially reported.
So, I have adjusted the sync config as follows:if (issuetype == "bug") { ... update bug specific fields Epic.receive() } else if (issuetype == "epic") { ... update epic specific fields def epicStatusValue = replica.customFields."Epic Status".value.value issue.customFields."Epic Status".value = nodeHelper.getOption(issue, "Epic Status", epicStatusValue) } else if (issuetype == "story") { ... update story specific fields Epic.receive() } else if (issuetype == "task") { ... update task specific fields Epic.receive() }
Notice the Epic.receive() code is at the end of the incoming sync (per the documention), but it is now inside all code sections EXCEPT the epic section, instead of at the end of all code.
So far, this seems to work.
I'll update it as I see more or less success.
- Francis Martens (Exalate)
Ah - thanks for the hint. We're reviewing the external script and will take this into account
Add your comment... - 10-1
I reproduced the problem as follows
- Setup a local connection
Add following code to the connection
if (firstSync) { ... if (issue.typeName == "Epic") { issue.customFields."Epic Name".value = "Hello" issue.customFields."Epic Status".value = "To Do" } }
- Trigger an exalate
- See that it fails with the failure
Then adapt the code to
if (firstSync) { ... if (issue.typeName == "Epic") { issue.customFields."Epic Name".value = "Hello" issue.customFields."Epic Status".value = nodeHelper.getOption(issue, "Epic Status", "To Do") } }
And now it works.
Give it a try
- Kevin Ketchum
I'll try it out - but first I have a question.
You are using the qualifier
if (firstSync) {
}
What happens if this is not the first sync but, instead, is an update?What is the actual affect of using (or not using) the firstSync qualifier ?
- Francis Martens (Exalate)
That is completely fine.
- Kevin Ketchum
It looks like the Epic Status was settable during initial issue creation.
However, whenever I use this code:
issue.customFields."Epic Status".value = nodeHelper.getOption(issue, "Epic Status", "To Do")
to update the issue (specifically, change the Epic Status), I get the same error:
Could not update issue `10,034`: Field customfield_10012: Specify a valid 'id' or 'name' for Epic Status.
Add your comment...
Question by Kevin Ketchum:
I am getting this error in the sync attempt while trying to sync the Epic Status value:
Field Specify a valid 'id' or 'name' for Epic Status: customfield_10012.
This is my setting on the incoming script - as you can see, I'm setting it to a specific value:
issue.customFields."Epic Status".value = "To Do"
Jira Server Outgoing:
Jira Cloud Incoming:
Hi
From the line:
Could you verify that the custom field Id "10003" is the correct one for the Epic Status field, usually 10003 is used for Epic Name.
Kind regards,
Daniel
I have confirmed in our system, the Epic Status internal ID is 10003.
In case this helps, the replica data from our system (when looking at the error in the cloud instance) shows this for the Epic Status field:
Another observation:
When I use this to attempt update the Epic Status field:
I get this in the stack trace.
Using Postman, when I use this JSON to attempt to update the field, I get the exact same error
(the top is the JSON I use in the PUT, and the bottom is the results)
However, when I use this JSON format, the field is updated correctly: