Buy anything from HongKong - Dealextreme

You can buy any kind of electronic gadgets from DealExtreme with free shipping option.
Please visit DealExtreme for very low prices.
Here is the link to the site : www.dealextreme.com

05 November 2013

Automatic creation of jira tasks by using Script Listeners

  1. In the Script Listeners section select "Create a subtask" for automatic creation of subtasks.
  2. In the Script Listeners section select "Clones an issues and links" for automatic creation of the same task in another project


Sample condition: 

(issue.projectObject.name != "PRJ" && issue.issueTypeObject.name == 'Project') || (issue.projectObject.name == "PRJ" && issue.issueTypeObject.name == 'Incident' && issue.components.name.contains('CRM'))

Sample Modification: 


import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.customfields.manager.OptionsManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.bc.project.component.ProjectComponent
import java.util.List
import java.util.ArrayList
import com.atlassian.jira.bc.project.component.ProjectComponent
def optionsManager = ComponentManager.getComponentInstanceOfType(OptionsManager.class)
def cf = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Support Needed In'}
def fieldConfig = cf.getRelevantConfig(issue)
def option = optionsManager.getOptions(fieldConfig).find {it.value == "Internal Test"}
issue.setCustomFieldValue(cf, option)
issue.summary = issue.summary + " - Support (Internal Test)"
if(issue.projectObject.name == "MSP-PRJ"){
    def component = ComponentAccessor.getProjectComponentManager().findByComponentName(10500,'CRM')
    List l = new ArrayList()
    l.add(component)
    issue.setAssignee(ComponentAccessor.getUserUtil().getUser('egulec'))
    issue.setComponentObjects(l)
}

No comments: