Hi All
I am using script runner plugin to get the issue key from repository branch.
I added the scriptable task in the bamboo job.
import com.atlassian.bamboo.variable.CustomVariableContext
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.bamboo.build.JiraIssueResultsManager
import com.atlassian.bamboo.plan.PlanKey
import com.atlassian.sal.api.component.ComponentLocator
import java.util.regex.Pattern
import org.apache.log4j.Logger
import org.apache.log4j.Level
def log = Logger.getLogger("com.atlassian.bamboo.user.BambooUserManagerImpl")
log.setLevel(Level.WARN)
def variableContext = ComponentLocator.getComponent(CustomVariableContext)
def planbranch = variableContext.getVariableContexts().get("planRepository.branchName")?.getValue()
log.warn "**************plankey is : $planbranch**************"
log :
**************plankey is : feature/TM-1-addition-of-2-numbers**************
I am getting the name of the branch . How to get the issue key (TM-1)from it (feature/TM-1-addition-of-2-numbers) using groovy script?
any suggestion would be appreciable
please help me
Regards
Sushma