createComponent

    Signature

    HelpernodeHelper
    Signature
    createComponent(IHubIssue issue, 
    String componentName, 
    String description, 
    String leadAccountId,
    String assigneeType)
    Description

    Creates a new IHubComponent in the project that the issue belongs to.

    Introduced in1.2.0

    Parameters

    issueThe issue where the component needs to be created
    componentNameThe component name
    descriptionThe description for the component, e.g. Database
    leadAccountIdThe account Id of a lead
    assigneeType

    The type assignee - can be one of following (strings)

    • PROJECT_DEFAULT
    • COMPONENT_LEAD
    • PROJECT_LEAD
    • UNASSIGNED


    Example use

    issue.components = replica.components.collect {  
    	remoteComponent -> nodeHelper.createComponent( 
    		issue,  remoteComponent.name, remoteComponent.description, null, "PROJECT_DEFAULT"
    		) 
    	 }

    Comments

    • The Component is NOT automatically added to any of the fields of the issue.
    • If a version with the same name already exists, then the existing component will be returned and no new component will be created.
    • The component is created in the project where the issue resides
    • Returns a component or null if the version could not be created
    • Set leadAccountId to 'null' in case no lead should be set
    • When assigneeType is null, createComponent will return null.