Please advise how to use a post function in a workflow to carry over the ticket A's labels to the linked ticket B when closing A as a duplicate to B.
I can confirm with ScriptRunner for Jira Cloud you could loop over the linked issues and then call the Edit Issue rest API to set the labels from the first linked issue to the next linked issue when a linked issue is closed.
I can confirm we have an example Script here which can be run on the script console and shows how to copy the labels from one issue to all its linked issues and you will be able to use this script as a reference guide to help create the script that you require.
Hey @Eric Yang , are you on Cloud and are the duplicates usually created manually?
A preventive measure could be this addin I've just shipped, which warns users in case they create duplicates: https://marketplace.atlassian.com/apps/1224559/no-duplicate-issues-jira-cloud
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events