Hi there,
i am sure this is a quite basic question, but i wasted a lot of time yet, and didnt get the point. So i ask here:
I am trying to fill a new generated ticket via automation. It works quite well, as long as i can use the click method, but when going for the "additional fields" i fail. I have to do it that way, because clicking doesnt offer me all the fields i need.
So i already found out my customfield is: customfield_13374
What i want is that the customfield gains the value of the same customfield, but in the trigger ticket. So i tried different variances of:
{
"fields": {
"customfield_13311": {{ triggerIssue.customfield_13311.value }}
}
}
The Field i am trying to copy from and to is a User Picker. I think that there might be my misstake somewhere. I´d have to do this for some different type of fields, if the first one works finally.
Whatever i do, the field always remains empty, or the automation fails.
Can you help me out?
Thank you very much.
Have a nice day
Michael
Hi @Michael
I have noticed some odd behaviors when fields are empty/nil, causing rules to either fail or show false success. To work around this you could:
Best regards,
Bill
Hello @Bill Sheboy
thanks for your reply. Giving a default would be a nice option, but i didnt quite get how to do this.
I tried it this way and also with the default area within the fields part, but in both cases he doesnt like it because it isnt a valid json for him. How to do it right?
{
{{"customfield_13311"|"0"}}
"fields": {
"customfield_13311": {"id":"{{triggerIssue.customfield_13311}}"}
}
}
Also is there a link to the documentation on how to do if - else statements i didnt really find anyhting while going through it, and it would be really helpful in several future tasks i guess.
Have a nice day
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Michael
Regarding default values, I have only used the inline/smart value method noted, not in the JSON. Try experimenting around with the quotes to see if that is the issue, or see if you can learn more here: https://support.atlassian.com/jira-software-cloud/docs/what-are-smart-values/
And, here is the documentation info on the if/else structure for rules:
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, i came a lot further, just to get to the next problem.
Working is:
"fields": {
"customfield_13311": {"id":"{{triggerIssue.customfield_13311}}"}
But if the field is not filled, he stops the automation there, instead of just taking an empty value too....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
What is the field type? I tried the following as smart values for text, number, and datetime fields and it worked to handle an empty fields as an empty string: {{issue.somefield|""}}
When I exported the rule JSON, it escapes the quotation marks, so try that if entering the JSON directly: {{issue.somefield|\"\"}}
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.