Hi,
I learned that JMWE plugin post function - "Transition Parent Issue" based on linked issues statuses has an issue with Jira 7.x when parent issue transition is having conditions/ validations. https://jira.atlassian.com/browse/JRASERVER-44681
So i have written a groovy script that validates the all linked issue statuses and do the transition on Epic issue. (In My case all issue types have the same workflow and Epic has the different workflow)
1. Navigate to a linked issueType workflow
2. Add a postfunction - (Transition linked issues (JMWE add-on) Function)
3. Add the transition ID
4. Issue Link is selected as 'has Epic (from Story to Epic)'
5. Added following script as groovy condition
At the end i can verify that, even i !=noOfIssues, still the current transition executing the Epic transition. Could you please help on this ?
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CommentSystemField
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.IssueManager
import com.atlassian.fugue.Option
import com.atlassian.jira.issue.Issue
import com.opensymphony.workflow.InvalidInputException
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.web.bean.PagerFilter
def issue = issue as Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def epicLinkCf = customFieldManager.getCustomFieldObjectByName("Epic Link")
def epicLink = issue.getCustomFieldValue(epicLinkCf) as Issue
def epicLinkManagerImpl = getBean("epicLinkManagerImpl");
issuesInEpic = epicLinkManagerImpl.getIssuesInEpic(epicLink)
def noOfIssues = issuesInEpic.size()
def i = 0
for (child in issuesInEpic) {
def status = child.getStatus().getName()
if ((status.equalsIgnoreCase('ABANDONED'))||(status.equalsIgnoreCase('REJECTED'))||(status.equalsIgnoreCase('NOT APPLICABLE'))){
i = i+1
}
}
if (i.equals(noOfIssues)){
return true
}
else {
return false
}
def getBean(String beanId)
{
def ghPlugin = ComponentAccessor.getPluginAccessor().getEnabledPlugin("com.pyxis.greenhopper.jira")
def descriptor = ghPlugin.getModuleDescriptor("greenhopper-launcher")
def applicationContext = descriptor.getModule().greenHopperCacheManager.applicationContext
def beanInstance = applicationContext.getBean(beanId)
return beanInstance;
}
Hey, the above code is working without any issues.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.