Forums

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

Smart values in a post function to Update Issue Custom Field

Charles Liss August 26, 2022

I have a custom list field that I want to update with a smart value in a post function.  However, when the post runs the list doesn't update.  What I am attempting to do is populate the list with the value in this substring. {{issue.components.name.substringBefore("|")}}

I have tested this out using a rule and pushing the result to comment so I know the substring request is sound.  I am starting to think maybe this doesn't work the way I expect inside this function. If so is there another way to go about it. 

If there is a way to update a custom field based on this smart value on a transition I'd love to hear about it!

Example.  

Component = Team | Feature

Customer List = [POST] Set Value = {{issue.components.name.substringBefore("|")}}

1 answer

1 accepted

3 votes
Answer accepted
Pramodh M
Community Champion
August 26, 2022

Hi @Charles Liss 

You can use %%CURRENT_DATETIME%% and %%CURRENT_USER%% expressions to update date/time and user. Other than that you cannot use smart values in the Post function, these are for Atlassian Automation 

You can use the Jira Automation feature to update the field

The trigger would Issue transition and add the condition if it's required and then add the action with updating the issue with the relevant custom field value to copy components

Let me know if this helps!!

Thanks,
Pramodh

 

Charles Liss August 26, 2022

Bummer but I was resigning to that being true.  Okay so If I am stuck with Automation then when would you recommend? 

I just discovered that you can maybe place a smart value inside the Edit Issue action but when I trigger the rule (transition) the custom list doesn't update. 

 

~Charles

Pramodh M
Community Champion
August 26, 2022

@Charles Liss 

Trigger - transition issue

Condition - add it appropriately

Action - edit issue ( select the custom field and add the smart value )

Charles Liss August 26, 2022

Yeah, that's exactly what I have set up.  I have even made sure the value I am extracting from the component equals that of the custom list.  When the rule fires i log it out to the comments to verify the results of the smart value.

Screen Shot 2022-08-26 at 8.07.52 PM.png

Like Sanjog Sigdel likes this
Pramodh M
Community Champion
August 26, 2022

@Charles Liss 

To troubleshoot and see what's logging use log action Action 

Thanks

Charles Liss August 29, 2022

Audit logging is very helpful and I forgot about that thanks.  Part of my issue was a trailing white space and another was how I accessed the customer list.  For unknown reasons only issue.customfield_id would work but that's okay.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events