Class JiraClientSvcImpl
- java.lang.Object
-
- org.jenkinsci.plugins.jiraext.svc.impl.JiraClientSvcImpl
-
- All Implemented Interfaces:
JiraClientSvc
public final class JiraClientSvcImpl extends Object implements JiraClientSvc
- Author:
- dalvizu
-
-
Constructor Summary
Constructors Constructor Description JiraClientSvcImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCommentToTicket(String jiraIssueKey, String comment)
Add a comment to a ticketvoid
addFixVersion(String jiraIssueKey, String newFixVersion)
Add a Fix Version to a field, if it doesn't already exist.void
addLabelToField(String jiraIssueKey, String jiraFieldName, String fieldContent)
Adds a label to a ticket's field of the label type.void
addLabelToTicket(String jiraIssueKey, String labelsToAdd)
Add a label to a ticketvoid
changeWorkflowOfTicket(String jiraIssueKey, String transitionName)
Apply the transition to a ticketObject
getFieldValue(String jiraTicket, String jiraFieldId)
Map<String,String>
getJiraFields(String issueKey)
Get a map of fieldIds to fieldName for the given issue keynet.rcarz.jiraclient.JiraClient
newJiraClient()
Create a new JiraClient from config, if you want to do some really custom JIRA operations using the rcarz client.void
setJiraClientFactory(JiraClientFactory jiraClientFactory)
void
updateMultiSelectField(String jiraIssueKey, String jiraFieldName, String... values)
Update a ticket's field with a multi-select value.void
updateStringField(String jiraIssueKey, String jiraFieldName, String content)
Update ticket ticket's field with a string value
-
-
-
Method Detail
-
newJiraClient
public net.rcarz.jiraclient.JiraClient newJiraClient()
Description copied from interface:JiraClientSvc
Create a new JiraClient from config, if you want to do some really custom JIRA operations using the rcarz client.- Specified by:
newJiraClient
in interfaceJiraClientSvc
- Returns:
- a JiraClient configure with global config
-
setJiraClientFactory
@Inject public void setJiraClientFactory(JiraClientFactory jiraClientFactory)
-
addCommentToTicket
public void addCommentToTicket(String jiraIssueKey, String comment) throws net.rcarz.jiraclient.JiraException
Description copied from interface:JiraClientSvc
Add a comment to a ticket- Specified by:
addCommentToTicket
in interfaceJiraClientSvc
- Parameters:
jiraIssueKey
- - the issue key (ex: JENKINS-101)comment
- - the comment to add. Can use JIRA markup- Throws:
net.rcarz.jiraclient.JiraException
-
addLabelToTicket
public void addLabelToTicket(String jiraIssueKey, String labelsToAdd) throws net.rcarz.jiraclient.JiraException
Description copied from interface:JiraClientSvc
Add a label to a ticket- Specified by:
addLabelToTicket
in interfaceJiraClientSvc
- Parameters:
jiraIssueKey
- - the issue key (ex: JENKINS-101)labelsToAdd
- - the label to add- Throws:
net.rcarz.jiraclient.JiraException
-
changeWorkflowOfTicket
public void changeWorkflowOfTicket(String jiraIssueKey, String transitionName) throws net.rcarz.jiraclient.JiraException
Description copied from interface:JiraClientSvc
Apply the transition to a ticket- Specified by:
changeWorkflowOfTicket
in interfaceJiraClientSvc
- Parameters:
jiraIssueKey
- - the issue key (ex: JENKINS-101)transitionName
- - the name of the transition- Throws:
net.rcarz.jiraclient.JiraException
-
updateStringField
public void updateStringField(String jiraIssueKey, String jiraFieldName, String content) throws net.rcarz.jiraclient.JiraException
Description copied from interface:JiraClientSvc
Update ticket ticket's field with a string value- Specified by:
updateStringField
in interfaceJiraClientSvc
- Throws:
net.rcarz.jiraclient.JiraException
-
updateMultiSelectField
public void updateMultiSelectField(String jiraIssueKey, String jiraFieldName, String... values) throws net.rcarz.jiraclient.JiraException
Description copied from interface:JiraClientSvc
Update a ticket's field with a multi-select value.- Specified by:
updateMultiSelectField
in interfaceJiraClientSvc
- Throws:
net.rcarz.jiraclient.JiraException
-
addLabelToField
public void addLabelToField(String jiraIssueKey, String jiraFieldName, String fieldContent) throws net.rcarz.jiraclient.JiraException
Description copied from interface:JiraClientSvc
Adds a label to a ticket's field of the label type.- Specified by:
addLabelToField
in interfaceJiraClientSvc
- Throws:
net.rcarz.jiraclient.JiraException
- if issue cannot be accessed or field cannot be accessed or updated
-
addFixVersion
public void addFixVersion(String jiraIssueKey, String newFixVersion) throws net.rcarz.jiraclient.JiraException
Description copied from interface:JiraClientSvc
Add a Fix Version to a field, if it doesn't already exist.- Specified by:
addFixVersion
in interfaceJiraClientSvc
- Throws:
net.rcarz.jiraclient.JiraException
- if the fix version or issue does not exist, or if there was a problem getting the issue
-
getJiraFields
public Map<String,String> getJiraFields(String issueKey) throws net.rcarz.jiraclient.JiraException
Description copied from interface:JiraClientSvc
Get a map of fieldIds to fieldName for the given issue key- Specified by:
getJiraFields
in interfaceJiraClientSvc
- Returns:
- a map of fieldIds to their fieldNames
- Throws:
net.rcarz.jiraclient.JiraException
-
getFieldValue
public Object getFieldValue(String jiraTicket, String jiraFieldId) throws net.rcarz.jiraclient.JiraException
- Specified by:
getFieldValue
in interfaceJiraClientSvc
- Throws:
net.rcarz.jiraclient.JiraException
-
-