I have this JSON script under Additional Fields in Project Automation (for Cloning project):
{
"update": {
"labels": [{
"add": "cloned"
}],
"fields": [{
"customfield_12903": "{{triggerIssue.customfield_12903}}"
}],
"issuelinks": [{
"add": {
"type": {
"name": "Cloners"
},
"outwardIssue": {
"key": "{{issue.key}}"
}
}
}]
}
}
When I try to publish the rule, I get this error:
Additional fields contains invalid field(s) in 'update' or 'fields' section: fields
the customfield_12903 is present in both projects.
What is the type of your customfield_12903? The syntax you are trying works for a plain text field, so if it is something else please check the examples in the documentation for any missing attributes: https://confluence.atlassian.com/automation/advanced-field-editing-993924663.html
You also appear to have some extra square brackets for the "fields" section, and your "issuelinks" should be in the "update" section rather than stand-alone. Perhaps try this:
{
"update": {
"labels": [ { "add": "cloned" } ],
"issuelinks": [ { "add": {
"type": { "name": "Cloners" },
"outwardIssue": { "key": "{{issue.key}}" }
} } ]
},
"fields": {
"customfield_12903": "{{triggerIssue.customfield_12903}}"
}
}
Kind regards,
Bill
Thank you!
It is a date field.
Does it make a difference in the formatting of the fields statement?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good news! it works!!!! thanks much!!!
Since its a date, it is copied over as a previous date. Any thoughts? For eg, 18 Mar 2022 is copied over as 17 Mar 2022
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is curious...as both are for the same custom field it does not appear to be a date/time to date conversion issue.
I wonder are both for the same time zone? You could test that by forcing the value to your time zone before using it with convertToTimeZone()
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still having the same error!
Do you know how to maybe use plus/minusDays function to overcome this issue?
I tried this but it didn't seem to work(Solved: plusdays function not working when I pass in a var... (atlassian.com)
Maybe my syntax is wrong....not a valid JSON is the error I get:
"fields": {
{{"customfield_12903"}}func=plusBusinessDays({{triggerIssue.customfield_12903|1}})
}
Appreciate the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If both fields are the same type and it is not a time zone issue, you may want to submit a support ticket to Atlassian first. Just adding/subtracting the day to solve this may mask a different problem we are not noticing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Both fields are of the same type and I agree with your reply. Will try and create an Atlassian ticket. Do you have a link for it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is the link: https://support.atlassian.com/contact/#/
If you are a site admin permission (or higher) you can submit the ticket; otherwise ask your site admin to do so and to add you to notifications.
Once you hear back from them, please post what you learn to help the community. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.