I am using 2 automation rules for producing sub features for Jira data center when the user clicks on a given transition. 
The first automation rule is reponsible for giving me a summary about the actions that will be executed. Here is my first automation rule: 
Here is the code for the first automation rule:
<span>package</span> SuperFeature
<span>import</span> com.atlassian.jira.issue.Issue
<span>import</span> org.apache.log4j.Logger
<span>import</span> com.atlassian.jira.project.version.Version
<span>import</span> com.atlassian.jira.bc.project.component.ProjectComponent
<span>import</span> com.atlassian.jira.bc.project.component.ProjectComponentManager
<span>import</span> com.atlassian.jira.security.JiraAuthenticationContext
<span>import</span> com.atlassian.jira.component.ComponentAccessor
<span>import</span> com.atlassian.jira.issue.label.LabelManager
<span>def</span> <span>log</span> <span>=</span> Logger.getLogger(<span>'atlassian-jira.log'</span>)
List < String > componentList = <span>new</span> <span>ArrayList</span> < String > ()
<span>def</span> <span>projectNames</span> <span>=</span> [ <span>'WF'</span>, <span>'BF'</span>, <span>'EF'</span>, <span>'YF'</span>, <span>'CLTF'</span>]
log.warn(<span>"=====MOUNA CAMELIA ISSUE 1:::: "</span>+ issue )
log.warn(<span>"=====MOUNA CAMELIA ISSUE:::: "</span>+ issue +<span>" ISSUE COMPONENTS "</span>+issue.getComponents())
<span>if</span> (issue.getComponents().size() == <span>0</span>) {
issue.update {
<span>String</span> <span>text</span> <span>=</span> <span>"Issue does not have any components\n"</span>
setCustomFieldValue(<span>'Execution Summary'</span>, text )
}
} <span>else</span> <span>if</span> (issue.getFixVersions().size() == <span>0</span>) {
issue.update {
<span>String</span> <span>text</span> <span>=</span> <span>"Issue does not have any fix versions\n"</span>
setCustomFieldValue(<span>'Execution Summary'</span>, text)
}
} <span>else</span> {
<span>int</span> <span>componentSize</span> <span>=</span> issue.getComponents().size()
<span>int</span> generatedIssuesCounter= <span>0</span>
<span>for</span> (ProjectComponent component: issue.getComponents()) {
<span>String</span> <span>componentName</span> <span>=</span> component.getName()
<span>def</span> <span>shortenedComponentName</span> <span>=</span> componentName.substring(componentName.indexOf(<span>"-"</span>) + <span>1</span>)
<span>def</span> <span>projectName</span> <span>=</span> componentName.substring(<span>0</span>, componentName.indexOf(<span>"-"</span>))
<span>if</span>(projectNames.contains(projectName)){
<span>def</span> <span>newIssueproject</span> <span>=</span> ComponentAccessor.projectManager.getProjectObjByKey(projectName)
<span>//log.warn("MOUNA CAMELIA found--"+found+"--NEW LIST SIZE: "+newList)</span>
List < ProjectComponent > newList = <span>new</span> <span>ArrayList</span> < > (newIssueproject.getComponents());
<span>def</span> <span>found</span> <span>=</span> newList.any {
it.getName().equals(shortenedComponentName)
}
<span>if</span> (found) {
componentList.add(componentName+<span>" ===> WILL BE GENERATED"</span>)
generatedIssuesCounter++
} <span>else</span>{
componentList.add(componentName+<span>" ===> CANNOT BE GENERATED"</span>)
}
}
}
issue.update {
<span>String</span> <span>text</span> <span>=</span> <span>"The super feature "</span> + issue + <span>" will be split into "</span> + generatedIssuesCounter + <span>" features, one for each component:\n"</span>
text = text + componentList.join(<span>"\n"</span>) ;
<span>// Partition a list into list of lists size 3</span>
setCustomFieldValue(<span>'Execution Summary'</span>, text)
}
}
The second code for my automation rule is responsible for generaring child features depending on the component under question. For example, since we have the componet EF-ADMAF, I would generate a child fetaure that belongs to the project EF and that has the component ADAMF.
Here is the 2nd automation rule: 
Here is the code for my 2nd automation rule:
<span>package</span> SuperFeature
<span>import</span> com.atlassian.jira.issue.Issue
<span>import</span> org.apache.log4j.Logger
<span>import</span> com.atlassian.jira.project.version.Version
<span>import</span> com.atlassian.jira.bc.project.component.ProjectComponent
<span>import</span> com.atlassian.jira.bc.project.component.ProjectComponentManager
<span>import</span> com.atlassian.jira.security.JiraAuthenticationContext
<span>import</span> com.atlassian.jira.component.ComponentAccessor
<span>import</span> com.atlassian.jira.issue.label.LabelManager
<span>def</span> <span>log</span> <span>=</span> Logger.getLogger(<span>'atlassian-jira.log'</span>)
List < ProjectComponent > finalComponentList = <span>new</span> <span>ArrayList</span> < ProjectComponent > ()
<span>def</span> <span>projectNames</span> <span>=</span> [ <span>'WF'</span>, <span>'BF'</span>, <span>'EF'</span>, <span>'YF'</span>, <span>'CLTF'</span>]
<span>int</span> <span>componentSize</span> <span>=</span> issue.getComponents().size()
<span>int</span> generatedIssuesCounter= <span>0</span>
<span>for</span> (ProjectComponent component: issue.getComponents()) {
<span>String</span> <span>componentName</span> <span>=</span> component.getName()
<span>def</span> <span>shortenedComponentName</span> <span>=</span> componentName.substring(componentName.indexOf(<span>"-"</span>) + <span>1</span>)
<span>def</span> <span>projectName</span> <span>=</span> componentName.substring(<span>0</span>, componentName.indexOf(<span>"-"</span>))
<span>if</span>(projectNames.contains(projectName)){
<span>def</span> <span>newIssueproject</span> <span>=</span> ComponentAccessor.projectManager.getProjectObjByKey(projectName)
List < ProjectComponent > newList = <span>new</span> <span>ArrayList</span> < > (newIssueproject.getComponents());
<span>def</span> <span>found</span> <span>=</span> newList.any {
it.getName().equals(shortenedComponentName)
}
<span>if</span> (found) {
finalComponentList.add(component)
generatedIssuesCounter++
}
}
}
createFeature(issue, finalComponentList)
<span>void</span> <span>createFeature</span><span>(Issue issue, Collection < ProjectComponent > componentList)</span> {
<span>JiraAuthenticationContext</span> <span>authenticationContext</span> <span>=</span> ComponentAccessor.getJiraAuthenticationContext();
<span>long</span> <span>issueLinkType</span> <span>=</span> <span>10070</span> as <span>long</span>
<span>long</span> <span>sequence</span> <span>=</span> <span>1</span> as <span>long</span>
<span>long</span> <span>myissueID</span> <span>=</span> issue.getId() as <span>long</span>
<span>// the key of the project under which the version will get created</span>
<span>final</span> <span>String</span> <span>projectKey</span> <span>=</span> <span>"SF"</span>
<span>// the start date - optional</span>
<span>final</span> <span>Date</span> <span>startDate</span> <span>=</span> <span>null</span>
<span>// the release date - optional</span>
<span>final</span> <span>Date</span> <span>releaseDate</span> <span>=</span> <span>null</span>
<span>// a description for the new version - optional</span>
<span>final</span> <span>String</span> <span>description</span> <span>=</span> <span>null</span>
<span>// id of the version to schedule after the given version object - optional</span>
<span>final</span> <span>Long</span> <span>scheduleAfterVersion</span> <span>=</span> <span>null</span>
<span>// true if this is a released version</span>
<span>final</span> <span>boolean</span> <span>released</span> <span>=</span> <span>false</span>
<span>def</span> <span>project</span> <span>=</span> ComponentAccessor.projectManager.getProjectObjByKey(projectKey)
<span>assert</span> project: <span>"Could not find project with key $projectKey"</span>
<span>ProjectComponentManager</span> <span>projectComponentManager</span> <span>=</span> ComponentAccessor.getProjectComponentManager()
<span>for</span> (ProjectComponent component: componentList) {
<span>String</span> <span>componentName</span> <span>=</span> component.getName()
<span>def</span> <span>shortenedComponentName</span> <span>=</span> componentName.substring(componentName.indexOf(<span>"-"</span>) + <span>1</span>)
<span>def</span> <span>projectName</span> <span>=</span> componentName.substring(<span>0</span>, componentName.indexOf(<span>"-"</span>))
<span>def</span> <span>newIssueproject</span> <span>=</span> ComponentAccessor.projectManager.getProjectObjByKey(projectName)
log.warn(<span>"MOUNA CAMELIA HELLO 7 projectName--"</span> + newIssueproject + <span>"--"</span>)
List < String > newIssueProjectVersionIDs = <span>new</span> <span>ArrayList</span> < String > ()
newIssueProjectVersionIDs = newIssueproject.getVersions().collect {
it.getName()
}
log.warn(<span>"MOUNA CAMELIA HELLO 8 newIssueProjectVersionIDs--"</span> + newIssueProjectVersionIDs + <span>"--"</span>)
<span>def</span> <span>customField</span> <span>=</span> ComponentAccessor.getCustomFieldManager().getCustomFieldObject(<span>"customfield_10790"</span>); <span>// here replace the ID with ID of your custom field.</span>
<span>def</span> <span>value</span> <span>=</span> issue.getCustomFieldValue(customField);
log.warn(<span>"MOUNA CAMELIA HELLO 10 mynewVersions--"</span> + customField + <span>"--"</span>)
log.warn(<span>"MOUNA CAMELIA 11"</span>)
<span>// log.warn("MOUNA CAMELIA ISSUE FIX VERSIONS " + issue.getFixVersions()[0].getClass())</span>
<span>// log.warn("MOUNA CAMELIA NEW ISSUE PROJECT VERSIONS " + newIssueproject.getVersions()[0].getClass())</span>
<span>def</span> <span>matchedVersions</span> <span>=</span> issue.getFixVersions().intersect(newIssueproject.getVersions(), Version.NAME_COMPARATOR)
log.warn(<span>"MOUNA CAMELIA MATCHED VERSIONS "</span> + matchedVersions)
<span>// def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_10790");// here replace the ID with ID of your custom field.</span>
<span>// def value = issue.getCustomFieldValue(customField) ; </span>
<span>// newissue.setCustomFieldValue(customField, value)</span>
log.warn(<span>"MOUNA CAMELIA HELLO 6 newIssueproject "</span> + newIssueproject)
log.warn(<span>"MOUNA CAMELIA HELLO 7 component.getDescription() "</span> + component.getDescription())
log.warn(<span>"MOUNA CAMELIA HELLO 8 component.getLead() "</span> + component.getLead())
log.warn(<span>"MOUNA CAMELIA HELLO 9 component.assigneeType() "</span> + component.assigneeType)
log.warn(<span>"MOUNA CAMELIA HELLO 10 component.getProjectId() "</span> + component.getProjectId())
log.warn(<span>"MOUNA CAMELIA HELLO 11--"</span> + shortenedComponentName + <span>"--"</span>)
<span>ProjectComponent</span> <span>newComponent</span> <span>=</span> projectComponentManager.findByComponentName(newIssueproject.getId(), shortenedComponentName)
<span>def</span> <span>componentArray</span> <span>=</span> <span>new</span> <span>String</span>[<span>1</span>]
componentArray[<span>0</span>]=newComponent.getName()
<span>// newissue.setComponent(mynewComponentList)</span>
<span>// def newIssueCreated = newissue</span>
log.warn(<span>" MOUNA CAMELIA 2 =========================="</span>)
<span>def</span> <span>versionCreator</span> <span>=</span> ComponentAccessor.versionManager.&createVersion.rcurry(startDate, releaseDate, description, newIssueproject.id, scheduleAfterVersion, released)
<span>def</span> <span>mynewVersions</span> <span>=</span> issue.fixVersions.intersect(newIssueproject.versions, Version.NAME_COMPARATOR).collect {
versionCreator it.name + <span>'-Inbox'</span>
}
log.warn(<span>"MOUNA CAMELIA 12 "</span> + mynewVersions)
<span>// newissue.setFixVersions(mynewVersions)</span>
<span>Issue</span> <span>newissue</span> <span>=</span> Issues.create(projectName, <span>'Feature'</span>) {
setSummary(<span>"["</span>+shortenedComponentName+<span>"] "</span>+issue.getSummary())
setDescription(<span>"This feature has been generated as child of a super feature. Please use this text area to add child feature specific information."</span>)
setReporter(issue.getReporter())
setCustomFieldValue(customField.getFieldName(), value)
setFixVersions(mynewVersions as String[])
setComponents (componentArray as String[])
}
log.warn(<span>"MOUNA CAMELIA 13"</span>)
<span>long</span> <span>newIssueCreatedID</span> <span>=</span> newissue.getId() as <span>long</span>
<span>def</span> <span>labelManager</span> <span>=</span> ComponentAccessor.getComponent(LabelManager)
labelManager.addLabel(authenticationContext.getLoggedInUser(), newIssueCreatedID, <span>"SF-Child"</span>, <span>false</span>)
log.warn(<span>" MOUNA CAMELIA 4 =========================="</span>)
log.warn(<span>"MOUNA CAMELIA ===== myissueID ====="</span> + myissueID + <span>" =====newissueTypeID ====="</span> + newIssueCreatedID + <span>" =====issueLinkType ====="</span> + issueLinkType + <span>" =====sequence ====="</span> + sequence + <span>" =====authenticationContext.getLoggedInUser() ====="</span> + authenticationContext.getLoggedInUser())
newissue.link(<span>10070</span>, issue)
Collection < ProjectComponent > componentList2 = issue.getComponents()
log.warn(<span>"MOUNA CAMELIA COMPONENT LIST 2 "</span> + componentList2)
componentList2.removeAll(issue.getComponents())
log.warn(<span>"MOUNA CAMELIA COMPONENT LIST 2 "</span> + componentList2)
projectComponentManager.updateIssueProjectComponents(issue, componentList2)
}
}The problem is that after executing the first 2 automation rules, nothing changes and I need to do a refresh to see the results of the 2 first automation rules. How can I see the effects of the automation rule without hitting the refresh button?