Set Field Value From Linked Issue Function doesn't work when try to copy fix version or component fields from epic to story in create transition

Juha Aaltonen December 30, 2014

I have story workflow where I have this kind of post functions in create transition:

The following will be processed after the transition occurs

  • Creates the issue originally.
  • Re-index an issue to keep indexes in sync with the database.
  • The value of field Fix Version/s will be set from the issue linked to the current issue by the has Epic link type (replacing existing values).
  • The value of field Account will be set from the issue linked to the current issue by the has Epic link type (replacing existing values).
  • The value of field Component/s will be set from the issue linked to the current issue by the has Epic link type (replacing existing values).
  • Fire a Issue Created event that can be processed by the listeners.

But only that tempo account field is copied from epic to story.

What I do wrongly with those fix version and component fields?

5 answers

0 votes
Grzegorz Reglinski May 23, 2016

Edit — workaround JIRA.png

Workaround:

  1. Create transition from open to status open
  2. Get ID of this transition
  3. Edit transition Create
  4. Add post function: Transition (Transition 241 will be triggered on the issue)
  5. Edit transition hidden
  6. Add post function: Set Field Value from Linked Issue
  7. Add condition Hide transition from user

 

Patrik Ytterström June 25, 2019

This workaround looked like a solution for us when we tried to inherit values from a linked issue. But even if I do this transition it will set the Link after the hidden transition is done. I even tried to add a new status to be able to be able to inherit from linked issue.1.PNG2.PNG

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 25, 2019

I'm not sure you need any workaround in recent versions of JMWE for Jira Server. Which version are you using?

Patrik Ytterström June 27, 2019

Latest version 6.0.1 , the issuetype I need to inherit from is from Testflo "https://marketplace.atlassian.com/apps/1211393/testflo-test-management-for-jira?hosting=server&tab=overview"
I contacted the support:

The Create Defect operation on a Test Case adds the link after the issue is created, so the postfunction on the Create transition doesn't have access to this link. Unfortunately we cannot guarantee TestFLO's compatibility with other add-ons from the Atlassian Marketplace like JMWE.

0 votes
asiakaspalvelu January 4, 2015

My workaround solution for this:

 

In Epic workflow I have update stories transitions in every status. In that transition I run these posthooks:

  • The value of field Fix Version/s will be copied to the issues linked to the current issue by the is Epic of link type (replacing existing values).
  • The value of field Component/s will be copied to the issues linked to the current issue by the is Epic of link type (replacing existing values).
  • The value of field Account will be copied to the issues linked to the current issue by the is Epic of link type (replacing existing values).

 

In Story workflows create phase I have this posthook (after creates the issue oroginally posthook)

  • Transition Update stories will be triggered on all issues linked to the current issue through the has Epic link type.

 

Now story gets fix version, component and account fields from epic when it is created.

 

I'm not sure is that so pretty, but it works.

0 votes
David _old account_
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.
December 30, 2014

After investigation, here is what is happening:

  • if you modify a system field in a post-function during the create transition before the "Create the issue" function, it works, but you cannot access values from linked issues
  • if you modify a system field in a post-function during the create transition after the "Create the issue" function, you cannot access values from linked issues, but the changes are never written to the database

Apparently, the same limitation doesn't exist for custom fields.

See https://innovalog.atlassian.net/browse/JMWE-258

 

0 votes
David _old account_
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.
December 30, 2014

Actually, what I believe is happening is that no field gets copied, but you are getting the default value for your custom fields.

The reason is that when the Create transition is executed for the User Story, the link with the Epic is not yet created (it gets created after the User Story is fully created, because Links cannot be created before the User Story gets a final issue ID). Therefore, the post-functions find no Epic for the User Story.

This problem has been reported before on our issue tracker. 

Juha Aaltonen December 30, 2014

No, there is not any default values for account or PSI release fields. Set Field Value From Linked Issue Function inherits those values. I tried that many times, and it really does that. And I tried that function also in other transitions (when that story already exists) and same happening.

David _old account_
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.
December 30, 2014

So if you remove the post-functions for these custom fields from the Create transition, these fields are not correctly set? Strange. There is no difference between custom field and standard fields, as far as these post-functions are concerned...

0 votes
Juha Aaltonen December 30, 2014

Bit more debugging info. It seems that it can copy only custom fields. I add one more postfunction to copy PSI release custom field and that works fine. So it can copy my own custom fields like account and PSI release, but can't inherit system fields like component or fix version. Is that a bug or feature?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events