Forums

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

How do edit Epics through automation from one project board to another?

Sandi Slavko
Contributor
July 11, 2023

Hello, 

I have two separate project boards, and I am using workflow automations to copy stories from one project to another based on the department responsible for completing the story.  And I cannot seem to figure out how to code/automate the update of the Epic Links from one project to another.

Ex. Project A has a story that they need help from Project B to complete. 

So the story on Project A has all fields assigned and coded to a particular Epic (SFSD-2) (Assignee/Epic/Reporter/Description/Dept resp/etc) - and we have it coded when status is transitioned to 'x', a new story is created on Project B board with all pertinent information copied over.

But Project B board has a different Epic Link assigned for them (SL-2093) and the product owner would like all stories on Project B board to reflect their own Epics automatically - and not have to reassign them if possible. (Epics have the same name, just diff Epic Links)

I cannot seem to figure out in the automation rules, what triggers and coding I should use to ensure this happens correctly.

I would expect that Project A Epic "Rev.io Go-Live" (SFSD-2) would be able to be edited through automation to update on Project B to Epic "Rev.io Go-Live" (SL-2093).

Any thoughts on how to properly accomplish this?  I'm open to all suggestions. 

Thanks in Advance!

1 answer

1 accepted

0 votes
Answer accepted
Mark Segall
Community Champion
July 11, 2023

Hi @Sandi Slavko 

If your Epics indeed share the same name, you could do something like this with automation:

  • TRIGGER: Issue Transitioned (To Status X)
  • ACTION: Lookup Issues
    • Key != {{issue.Epic Link}} AND summary ~"\"{{issue.epic.summary}}\""
  • IF CONDITION (Advanced)
    If one and only one Epic is returned then link it to the Epic
    • {{lookupIssues.size}}
      Equals
      1
    • ACTION: Create Issue
      • Epic Link
        • {{lookupIssues.key}}
  • ELSE CONDITION
    More or less than 1 Epic was identified. This will simply create the issue and force you to manually set the Epic
    • ACTION: Create Issue

NOTE - The lookup action for this rule would require a multi-project scope so you need to be a Jira Admin to make it work.

Sandi Slavko
Contributor
July 11, 2023

Thanks @Mark Segall 

Please see the automation steps setup based on your suggestion above, does that looks correct?

Also, it appears to have created a 2ndary issue, but did not edit/update the epic link on originally transitioned/created story.

Sandi Slavko
Contributor
July 11, 2023

can i not attach screenshots or attachments here so you can see anymore?

Mark Segall
Community Champion
July 11, 2023

That rule was intended for the whole thing, replacing how you currently create the issue on issue transition and adding the Epic Link in that same step.

You should be able to attach screenshots still.  It's the 3rd option from the right in the editor menu

Sandi Slavko
Contributor
July 11, 2023

JIRA Epic Issue.jpgJIRA Epic Issue2.jpgJIRA Epic Issue3.jpg

Sandi Slavko
Contributor
July 11, 2023

I already have JMWE Post Functions automated to create the new issues on the respective boards.... I am just trying to update the Epic Links/Names to the corresponding Epics Links/Names on the newly created/transitioned issues. 

Is there a way to automate this portion that you are aware of?

If there is an Epic with the same name, transition it from SFSD-2 to SL-2093 so that the issues for the 'SL' board show only the 'SL' Epics?

Sandi Slavko
Contributor
July 11, 2023

@Mark Segall  in the screenshot above, I would expect SL-2370 issue to have the Epic Link updated from "SFSD-2" to corresponding Epic Link for the SL board - "SL-2093"

It seems to be stuck and staying at "SFSD-2"... 

I hope I'm not confusing you with what my goal is :)

Mark Segall
Community Champion
July 11, 2023

Thanks for the added context... So your post function is creating a new issue and assigning it to the same Epic as the source issue, correct?  You would modify the rule like this:

  • TRIGGER: Issue Created
  • CONDITION: Epic Link Is not empty
  • ACTION: Lookup Issues
    • Key != {{issue.Epic Link}} AND summary ~"\"{{issue.epic.summary}}\""
  • IF CONDITION (Advanced)
    If one and only one Epic is returned then link it to the Epic
    • {{lookupIssues.size}}
      Equals
      1
    • ACTION: Edit Issue
      • Epic Link
        • {{lookupIssues.key}}
  • ELSE CONDITION
    I would simply add a comment to reflect that the rule could not determine the Epic
    • ACTION: Add Comment
      • There were {{lookupIssues.size}} Epics found so the rule was unable to match the Epic.  Please manually update the Epic Link.
Sandi Slavko
Contributor
July 11, 2023

ok, it appears to have started working a bit, but is getting hung up and adding a comment to each test.  It appears that it's comparing any issue 'summary' looking for the phrase that matches the Epic.

Ex. Newly created issue (SL-2378) is failing to update the Epic because the Automation Rule is looking at a separate (historical) Issue SL-2216 Summary = "Rev.io Go Live To Do List" --- but Epic on this issue is "Salesforce Team"... so it's not updating my newly created SL-2378.

Is there any way to have it ONLY look at the Epic Name/Link and not any Summary or Description?

Epic Validation.pngEpic Validation1.pngEpic Validation2.png

I really do appreciate your insight, and I'm sure it's just one small change, but i cannot seem to figure it out.

Sandi Slavko
Contributor
July 11, 2023

Epic Validation.png

Mark Segall
Community Champion
July 11, 2023

Ahh... I would update the query to be specific to Epics:

Key != {{issue.Epic Link}} AND summary ~"\"{{issue.epic.summary}}\"" AND issueType = Epic
Sandi Slavko
Contributor
July 12, 2023

@Mark Segall  The automation piece appears to be working when transitioning and creating the new issue via the workflow post functions for this project in particular.

I am however, running into 2 issues noted below with screenshots:

1. When creating an issue directly on the project board where the automation is in place, it is keeping the assigned Epic on creation, but also flagging an error in the automation and adding the comment that '0 Epics found, unable to match, etc' -- Is it because it's looking for a 'matching' Epic and because it's the only one, is reading there is nothing to 'update'?

Epic not found.png

2. I attempted to add this automation to another project board (Project C) that will receive the same type of issues from master board (Project A) -- and I confirmed that all configs match the original (Project B) automation -- and I am getting an error in the JQL query.. not sure how this is possible if it works for the other project. (ugh)

SP board Query Error.png

SP board automation.png

What am I missing?

Mark Segall
Community Champion
July 12, 2023

When an issue is created by the post function does it add any distinguishing characteristic like a label or component to differentiate it from issues that are created manually?  If so, we can use that in a condition.  For example, let's say that issues created from the post-function have a label called MY_LABEL.  You'd update the rule as follows:

  • TRIGGER: Issue Created
  • CONDITION: Labels CONTAINS NONE OF MY_LABEL
  • CONDITION: Epic Link Is not empty
  • ACTION: Lookup Issues
    • Key != {{issue.Epic Link}} AND summary ~"\"{{issue.epic.summary}}\""
  • IF CONDITION (Advanced)
    If one and only one Epic is returned then link it to the Epic
    • {{lookupIssues.size}}
      Equals
      1
    • ACTION: Edit Issue
      • Epic Link
        • {{lookupIssues.key}}
  • ELSE CONDITION
    I would simply add a comment to reflect that the rule could not determine the Epic
    • ACTION: Add Comment
      • There were {{lookupIssues.size}} Epics found so the rule was unable to match the Epic.  Please manually update the Epic Link.

This would ensure that the rule only triggers when the issue was created via post function.

Like Sandi Slavko likes this
Sandi Slavko
Contributor
July 12, 2023

@Mark Segall  That was the distinction I needed! Thank you so much!

After multiple additional tests just to make sure all angles were covered, it is working exactly as I would expect now!  

I cannot thank you enough! Those smart values and JQL's always seem to get me & I need to become more familiar with them.

Have a wonderful day!!

Like Mark Segall likes this

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