Forums

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

Post-function in workflow works fine during create, but fails during clone

Julie Leonard June 12, 2024

We have been successfully using a story workflow that presents a pre-populated template for the Description and Acceptance criteria fields when creating a new story. A post-function copies the pre-formatted custom description and acceptance criteria field contents to the standard JIRA fields and then creates the issue with that. 

When I try to use the built-in Clone function (off the three dots), it fails saying I have to execute the post function "create issues originally" first. But doing that breaks the functionality during the Create process. 

I then tried to build a triggered automation copying the description and acceptance criteria fields from the trigger story, but those two fields always come across with the boilerplate preformatted text only. I think I am in some crazy situation where I would need to copy the trigger story Description and Acceptance criteria fields to the cloned preformatted custom fields and then the creation workflow would do the magic of moving that content correctly. 

I cannot for the life of me figure out how to write the "smart" code to make that happen or how to make the built-in clone work. Any help would be much appreciated. 

image.png

1 answer

1 accepted

1 vote
Answer accepted
Kuan Yi Ming _ServiceRocket_
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.
June 13, 2024

Hi Julie,

The Create Issue transition in any workflow comes with these three post-functions:

  1. Creates the issue originally.
  2. Re-index an issue to keep indexes in sync with the database.
  3. Fire a Issue Created event that can be processed by the listeners.

Any post-function you create in the workflow should ideally be placed below the "Creates the issue originally" post-function.

Regards
Yi Ming

Julie Leonard June 17, 2024

Hello Yi Ming - thank you for your answer. 

I made the change you suggestedimage.png

It still works correctly during the creation process. 

The error, I previously incurred during the built-in cloning no longer appears. 

However, the cloned issue doesn't show the description and acceptance criteria from the source story, but the boilerplate of a brand new story. I assume that is because it pulls the pre-populated versions into the cloned story after the creation of the clone. 

This seems like a chicken and egg scenario. :-(  

Do you or anyone else have any other suggestions? 

Julie Leonard June 17, 2024

BTW - While I would prefer to use the built-in clone functionality, as a workaround, I figured out a way to perform the clone with automation.

image.png

Like • Kuan Yi Ming _ServiceRocket_ likes this
Kuan Yi Ming _ServiceRocket_
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.
June 18, 2024

Hi Julie,

It should be possible to have additional post-functions in a workflow that copy additional fields using complex logic that determines if a created issue is a cloned issue. This will almost certainly require a third-party app on the Atlassian Marketplace to achieve, such as JMWE

Regards
Yi Ming

Julie Leonard June 19, 2024 edited

Thank you, Yi Ming. 

I checked out that component and it may help with that and other automations. Thank you so much. 

I think for now, I'll stay with the custom automation until we find the need for additional post-functions where that add-on may be useful. 

Thank you so much for your help in prodding my brain to look for alternate solutions. 

Best,

Julie

Suggest an answer

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

Atlassian Community Events