Jira Cloud Automation FixVersion from the user input
Asked by Szymon F:

Hi, I am struggling with the automation that is quite straightforward.

I have issue A, the automation starts from the *Action* button. The popus asks for the fixVersion to be provided and once it is completed the linked issue is created, lets call it issue B.

Here is the automation

![Screenshot 2024-01-09 at 13.54.44.png](https://community.atlassian.com/t5/image/serverpage/image-id/299636i48F43037A39B0B6D/image-size/large?v=v2&px=999 "Screenshot 2024-01-09 at 13.54.44.png")

and the specified value for the fixVersion in the issue B:

```
{
  "fields": {
  "fixVersions": [{ "value" : "{{userInputs.{{BackportFV}}}}" }]
 }
}
```

The automation creates the **Backport** issuetype but the fixVersion field does not populate to issue B FixVersion field. No errors in the audit log. Any hints?

I also tried to add a new component and edit the issue. Then the same code removes the FixVersion from the original ticket.


Answers:
author: Bill Sheboy
body: Hi [@Szymon F](/t5/user/viewprofilepage/user-id/3561857)

To set the Fix Version values with JSON the attribute is "name" and not "value". Please look here for more information: <https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Fix-Versions>

If that does not work, please post images of your Create Issue action and of the audit log details showing the rule execution. Those may provide context to explain what you are observing. Thanks!

Kind regards,  
Bill

comments: author: Szymon F
body: Hi [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) ,

thank you for the suggestion - I did try that already but then the logs looked like this:

![Screenshot 2024-01-10 at 11.40.35.png](https://community.atlassian.com/t5/image/serverpage/image-id/299851iB45CA747982943AE/image-size/large?v=v2&px=999 "Screenshot 2024-01-10 at 11.40.35.png")

Important note that the fixVersion exists in the project so the automation does not create it by itself.

Here is the automation:

![Screenshot 2024-01-10 at 11.42.35.png](https://community.atlassian.com/t5/image/serverpage/image-id/299853i192EBF8885768667/image-size/large?v=v2&px=999 "Screenshot 2024-01-10 at 11.42.35.png")

![Screenshot 2024-01-10 at 11.42.08.png](https://community.atlassian.com/t5/image/serverpage/image-id/299852i22B7F8D9EC70CF6B/image-size/large?v=v2&px=999 "Screenshot 2024-01-10 at 11.42.08.png")


author: Szymon F
body: I also made a change in the code based on your suggestion from the post: [https://community.atlassian.com/t5/Jira-Software-questions/automation-Add-fix-version-to-existing-fix-version-when-creating/qaq-p/1821136](https://community.atlassian.com/t5/Jira-Software-questions/automation-Add-fix-version-to-existing-fix-version-when-creating/qaq-p/1821136?)

```
{
 "update": {
  "fixVersions": [
   { 
    "add": {
     "name": "{{userInputs.{{BackportFV}}}}" 
     }
    }
   ]
  }
 }
```

but this also threw an error:

![Screenshot 2024-01-10 at 11.53.30.png](https://community.atlassian.com/t5/image/serverpage/image-id/299857i733F03DFB0757EC1/image-size/large?v=v2&px=999 "Screenshot 2024-01-10 at 11.53.30.png")

*** ** * ** ***

Another try with the hardcoded version id:

```
{
"fields": {
"fixVersions": [{ "id" : "17827" }]
}
}
```

works and the FixVersion is assigned to the new ticket

*** ** * ** ***

Another one, I saw somewhere that instead of the code I should be able to update the field in the SET option. But the smart value is not visible here:

![Screenshot 2024-01-10 at 12.24.16.png](https://community.atlassian.com/t5/image/serverpage/image-id/299861i37788FDCC65A418D/image-size/large?v=v2&px=999 "Screenshot 2024-01-10 at 12.24.16.png")

example [here](https://community.atlassian.com/t5/Automation-questions/How-to-use-the-new-quot-userInputs-quot-fields-to-set-custom/qaq-p/2390932#M7131)

*** ** * ** ***

I also put the code into the Description field:

```
1. {{userInputs.BackportFV}}
2. {{userInputs.{{BackportFV}}}}
```

and here is the outcome in the ticket:

1.

2. }}

so first of all the variable should be *{{userInputs.BackportFV}}*


author: Bill Sheboy
body: Thanks for that information, and I see some extra curly brackets in your smart value expressions which need adjustments.

First in your manual trigger, when defining a variable name, it does not include the brackets. Please remove those and only use BackportFV for the variable name. Later when it is referenced, it would include the brackets, like this: {{userInputs.BackportFV}}

And so the JSON needs updates also. Please try this one to **set** the value:

```
{
  "fields": {
    "fixVersions": [
      { "name": "{{userInputs.BackportFV}}" }
    ]
  }
}
```

As the rule is creating a new issue, the *update* is not used (because the issue does not exist yet).


author: Szymon F
body: Hi [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) the removal of extra brackets solved the problem.

Thank you for your help!


Tags: administration

cloud

jira-software

jira-software-cloud