Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial issue type by name #139

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,13 @@ class JiraDataService(
* @param imsProject The IMSProject to work with
* @return the IssueType
*/
suspend fun issueType(imsProject: IMSProject): IssueType {
suspend fun issueType(imsProject: IMSProject, name: String): IssueType {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing docs

Copy link
Contributor Author

@chriku chriku Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 079a9a4

val template = issueTemplate(imsProject)
val imsProjectConfig = IMSProjectConfig(helper, imsProject)
val namedType = template.issueTypes().firstOrNull { it.name == name }
if (namedType != null) {
return namedType
}
if (imsProjectConfig.defaultType != null) {
val type = neoOperations.findById<IssueType>(imsProjectConfig.defaultType)
if ((type != null) && (type.partOf().contains(template))) {
Expand Down
2 changes: 1 addition & 1 deletion sync-jira/src/main/kotlin/gropius/sync/jira/JiraSync.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ final class JiraSync(
override suspend fun fetchData(imsProjects: List<IMSProject>) {
for (imsProject in imsProjects) {
jiraDataService.issueTemplate(imsProject)
jiraDataService.issueType(imsProject)
jiraDataService.issueType(imsProject, "")
jiraDataService.issueState(imsProject, null, true)
jiraDataService.issueState(imsProject, null, false)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ data class IssueData(
issue.state().value = jiraService.issueState(imsProject, null, true)
issue.template().value = jiraService.issueTemplate(imsProject)
issue.trackables() += jiraService.neoOperations.findAll(Project::class.java).awaitFirst()
issue.type().value = jiraService.issueType(imsProject)
issue.type().value =
jiraService.issueType(imsProject, fields["issuetype"]?.jsonObject?.get("name")?.jsonPrimitive?.content!!)
return issue
}
}
Expand Down