Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Add Custom Field to Summary via smart value

Sean McC November 25, 2021

Hi, 

Using Jira Automation, I'm trying to update the summary field with a custom field [Target] (field type = date time picker). 

I have two automation rules. 1. Creates a standard issue type at a point in time. 2. Is triggered by the first and creates a list of sub-tasks. The problem is with the second part and the following information sheds some light below. 

Part of the automation rules runs as expected where it creates a list of sub-task with a summary and adds a value to the custom field [Target]. It seems the JSON is failing to input the custom field and append it to the summary despite the Audit logs showing as successful. 

  • Expected outcome is Summary "Task = Deadline = 2021-11-25 11:00"
  • Actual outcome is Summary "Task = Deadline ="

Automation rule (green is working / red is failing): 

AutomationRule.png

Output: 

AutomationRule2.png

I've also tried to run the script with the custom field id but to no success - {{issue.customfield_00000}}. Furthermore I've been able to test the rule with {{issue.created}} and it's working as expected. Not sure if the problem lies with the custom field type I am using.

Reason for automation rule

The 'Additional Fields' JSON to update the summary is being used as a workaround as in Jira Cloud it seems that updating the system setting 'jira.table.cols.subtasks' does not work. 

Ideally don't want users to click onto the sub-task to see the deadline for each task and would rather see run order of the sub-tasks on the standard issue, hence my direction of travel with this script. 

Eventually I'd like to use {{issue.target.shortTime}} smart value to just produce the target deadline in time format only (11:00).

Any help would greatly appreciated.

Thanks, 

Sean.

 

 

 

 

1 answer

1 accepted

0 votes
Answer accepted
Marco Brundel
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.
November 25, 2021

Hi @Sean McC ,

Is it a option to put

Task - Deadline = {{now.wtihHour(11).withMinute(0)}}

directly in the field Summary in your rule?

Screenshot 2021-11-25 at 16.34.08.png

Regards, Marco

Sean McC November 25, 2021

Cheers Marco, I'll give it a go now and will confirm shortly.

Ideally I'd like it to be driven from the custom field so I have the potential to run another rule to dynamically update should a user update the custom field however this is a good workaround so thank you! 

Like Marco Brundel likes this
Sean McC November 26, 2021

Quick update: the workaround works as expected. I've added '.shortTime' to enhance readability: 

AutomationRule3.PNG

Thanks @Marco Brundel, I'll accept your answer.

If I'm able to configure my original solution successfully I'll update this question.

Like Marco Brundel likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events