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

fix: Added support for update section in DoTransitionWithPayload struct #423

Merged
merged 4 commits into from
Feb 19, 2022
Merged

Conversation

CondensedTea
Copy link
Contributor

@CondensedTea CondensedTea commented Nov 25, 2021

Description

In this commit I've added Update field to CreateTransitionPayload, with this featrue it is now possible to perform transition with posting a comment

It is backward compatible

Related issue:
#248 -- author of issue decided to use self-made struct I've added in this PR

Jira API docs: link

Tested on Jira v8.5.9 (on-premise)

Example:

var comment = "Closed due to age"

i := CreateTransitionPayload{
		Updates: TransitionPayloadUpdate{
			Comment: []TransitionPayloadComment{
				{
					Add: TransitionPayloadCommentBody{Body: comment},
				},
			},
		},
		Transition: jira.TransitionPayload{
			ID: "171",
		},
		Fields: jira.TransitionPayloadFields{
			Resolution: &jira.Resolution{
				ID: "10101",
			},
		},
	}
	resp, _ := jiraClient.Issue.DoTransitionWithPayload(task.ID, issue)

Checklist

Tyshkevich Aleksandr Borisovich added 2 commits November 25, 2021 17:51
In this commit I've added Update field to CreateTransitionPayload, with this addition it is now possible to perform transition with posting a comment
Copy link
Collaborator

@benjivesterby benjivesterby left a comment

Choose a reason for hiding this comment

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

Please update the new fields to include omitempty in their struct tags

@CondensedTea
Copy link
Contributor Author

Please update the new fields to include omitempty in their struct tags

Thanks for pointing this out, fixed

@benjivesterby benjivesterby merged commit c0a2d48 into andygrunwald:master Feb 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants