Hi, how is the best way to set tempo account field when creating an issue? I have several issue types and I'd like to set them: issueType1 -> account1, issueType2 -> account2 during creation an issue. How to do it?
If they all have the same workflow create a post function at the Create transition, which will be an if/else statement with all the different issue types
import com.atlassian.jira.component.ComponentAccessor
// Define the id's of the tempo accounts here
def account1 = 1
def account2 = 2
// Define the Tempo Account custom field
def tempoAccField = ComponentAccessor.getCustomFieldObjectsByName("Tempo Account").head()
if(issue.getIssueType().getName().equals("IssueTypeA")){
issue.setCustomFieldValue(tempoAccField, account1)
} else if(issue.getIssueType().getName().equals("IssueTypeB")){
issue.setCustomFieldValue(tempoAccField, account2)
}
You can find the id's of the account in the Tempo Accounts section, if you click on the Tempo Team there will be an id in the URL. e.g.
"/secure/Tempo.jspa#/accounts/account/2/"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.