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

Copying custom fields to new ticket via automation

Mark January 20, 2022

I realise there are two or three previous threads on this but I've (carefully) applied their advice and it's still not working :D

I'm automating creating a new ticket when a ticket changes workflow status. I want to copy across a custom field with a numeric value to the new ticket. Here's the code I'm using:


{
"fields": {
"parent": {"id": "28996"},
"customfield_10413":"{{issue.customfield_10413}}"
}
}


(The "parent" setting is irrelevant but included just so you can see the full code)

In the automation logging, I get the following error:

Create issue
Error creating issue
Specify a number for the custom field (below 100,000,000,000,000) (customfield_10413)

 

In the names page for the ticket, the custom field value appears as follows:

"customfield_10413":4.0

Can anyone advise please?

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2022

Hi @Mark -- Welcome to the Atlassian Community!

Have you tried using this syntax to get the value of the field: {{issue.customfield_10413.value}}

Kind regards,
Bill

Mark January 21, 2022

Hi Bill, thanks for your reply. Tried that a few times yesterday, just tried it again and got the same error message.

Mark January 21, 2022

Screenshot 2022-01-21 080542.pngScreenshot 2022-01-21 080554.png

Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 21, 2022

First, confirm that the type of this custom value is indeed numeric. 

If so, I suspect the value (to the right of the colon) should not be quoted. See:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Using-smart-values

Consider testing this by hardcoding the JSON with a simple number, to see if that works. If it does, then focus on the smart value syntax for the value (without quotes).

"customfield_10413": 4
Like # people like this
Mark January 25, 2022

That's the one! Must have been the one combination I never tried - thank you so much!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events