Hello Everyone ,
I recently came across a requirement that I believe many of you may have encountered as well. While Atlassian’s documentation is comprehensive and well maintained, I wanted to share my approach here and get feedback from the community on how it could be improved.
The requirement was to copy values from multiple fields submitted via a form into a Jira field (in this case, the Description field).
In addition, I needed to apply an if–else condition:
If a user provides a value for a field, that value should be copied to the Jira field
If a user leaves a field empty, the Jira field should display “No value provided” instead. ( I figured it out that this will be the scenerio only in case of the Non-Mandatory fields).
Below is the approach I followed using Jira Automation and smart values. I’d be interested to hear if there’s a more efficient or cleaner way to handle this scenario.
As usual, I went through several Atlassian documentation pages related to using smart values in automation.
1. Copying field values using smart values
I used an automation rule with the Create Issue Trigger & Edit issue action on the Description field and smart values to copy the required field values.
This part was fairly straightforward and worked as expected.
2. Implementing the If / Else condition
The main challenge arose when implementing the if–else logic.
I reviewed multiple documentation examples, but the usage of the Else condition was not very clear especially for cases where field values might be empty or not exist at all (this was particularly true for User Picker fields, where an empty value does not always return a result).
To work around this, I used two separate If conditions:
The first condition checks whether the field is empty or does not exist
The second condition checks whether the field has a value, and if so, copies that value into the target Jira field
While this approach works, I’m curious if there’s a cleaner or more optimized way to handle this logic.
3. Copying attachments
I also attempted multiple approaches to copy attachments using automation, but none of them worked as expected.
Eventually, the Atlassian Support chatbot confirmed that copying attachments is currently not supported.That said, I’m still open to suggestions if anyone has found an alternative or workaround for this requirement.
Below are the smart values I used.
Smart Values and conditions :
* *What type of support* : {{issue.customfield_17513}}
* *Question or request* : {{issue.customfield_17452}}
* *System / Tool / Process* : {{issue.customfield_12670}}
* *Checked existing resources* : {{issue.customfield_17453}}
* *Urgency* : {{issue.customfield_17451}}
* *Manager* : {{#if(not(exists(issue.manager)))}}No Value Provided{{/}}{{#if(not(issue.manager.isEmpty))}}{{issue.manager.displayName}}{{/}}
* *Supporting Links* : {{#if(issue.customField_17716.isEmpty)}}No Value Provided{{/}}{{#if(not(issue.customField_17716.isEmpty))}}{{customField_17716}}{{/}}
* *Attachments* : Unable to determine a workable solution using Jira Automation.
While the solution is functional, there may be opportunities to optimize the conditional logic or reduce the overall complexity of the automation rule. I welcome any suggestions from the community on improving or simplifying this approach.
Thanks!!