How to leverage the Jira Java API createTeam method for Advanced Roadmaps
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Advanced Roadmaps provides the ability to create teams to work on specific parts of a plan. If wanting to create teams using the Java API (via something like ScriptRunner) for example, how should the createTeam API be used?
Environment
Jira 8.20 and higher
Solution
The createTeam API accepts a TeamDescription object as input. So in order to create a new team via the Java API you must pass in a TeamDescription object. For example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def newTeamDescription = new TeamDescription() {
@Override
public String getTitle() {
return teamName;
}
@Override
public Optional getAvatarUrl() {
return Optional.absent();
}
@Override
public boolean isShareable() {
return true;
}
}
teamService.createTeam(newTeamDescription)
⚠️ Please note this is just a sample code, your implementation may differ some or require customization. This snippet is just meant to demonstrate the basic use of the createTeam function specifically. This code would need to be built into a larger script for meaningful results.
Was this helpful?