Need help with conditional logic in Jira Service Management automation

I’m stuck trying to set up conditional logic in Jira Service Management. I want to show JobTitle and New Employee Name in a request type description only if there’s data in those fields. Here’s what I’ve tried:

####Employee First Name
{{issue.customfield_10096}}

####Employee Last Name
{{issue.customfield_10097}}

####Requested Changes
{{issue.customfield_10394}}

####Effective Date
{{issue.customfield_10015}}

{{#if({{EmployeeNewName}})}}
####Employee New Name
{{issue.customfield_10393}}
{{/}}

{{#if({{JobTitle}})}}
####Employee New Job Title
{{issue.customfield_10229}}
{{/}}

####Summary
{{issue.customfield_10198}}

But I’m getting an error about unclosed parameters. Can anyone spot what’s wrong with my setup? I’m new to this and could use some guidance on how to fix it. Thanks!

I’ve encountered similar issues with conditional logic in Jira Service Management. The problem in your setup is likely the syntax for the if statements. Try modifying your code to use the following format:

{{#if issue.customfield_10393}}
####Employee New Name
{{issue.customfield_10393}}
{{/if}}

{{#if issue.customfield_10229}}
####Employee New Job Title
{{issue.customfield_10229}}
{{/if}}

This should resolve the unclosed parameters error. The key is to reference the custom field directly in the if statement, rather than using a separate variable. Also, ensure you’re using the correct custom field IDs for your Jira instance. If you’re still having trouble, double-check that the custom fields are properly configured and accessible in your project settings.

hey sofiag, looks like ur missing the ‘if’ in ur closing tags. try this:

{{#if issue.customfield_10393}}
####Employee New Name
{{issue.customfield_10393}}
{{/if}}

{{#if issue.customfield_10229}}
####Employee New Job Title
{{issue.customfield_10229}}
{{/if}}

hope that helps! lemme kno if u need anything else

I’ve dealt with similar conditional logic challenges in Jira Service Management. One thing that’s helped me is using the ‘velocity’ syntax for these conditions. Here’s how I’d approach your scenario:

{{#if issue.customfield_10393}}
####Employee New Name
{{issue.customfield_10393}}
{{/if}}

{{#if issue.customfield_10229}}
####Employee New Job Title
{{issue.customfield_10229}}
{{/if}}

This syntax is more reliable in my experience. Also, make sure you’re using the correct custom field IDs for your specific Jira instance. Sometimes, field IDs can vary between different Jira setups.

Another tip: test your conditions with known data first. Create a test issue with values in these fields to ensure your logic works as expected before rolling it out. This approach has saved me countless headaches when setting up complex automations.