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

jira: Use fields in comment to merge in additional data #4304

Merged
merged 5 commits into from Mar 12, 2022
Merged

jira: Use fields in comment to merge in additional data #4304

merged 5 commits into from Mar 12, 2022

Conversation

Boosai
Copy link
Contributor

@Boosai Boosai commented Mar 1, 2022

SUMMARY

The 'fields' parameter could be used to merge in any arbitrary data to a jira comment.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Enhancement of comment creation in community.general.jira.

ADDITIONAL INFORMATION

In jira issue creation, the 'fields' parameter is used to pass in any arbitrary data.
We adopted this to work also in jira comment creation.

In our jira service desk environment, we use it to set a property to mark the comment as 'internal'.
Look at the example I added.

(Some explanation that helped to find the correct property for this:
https://stackoverflow.com/questions/45031475/how-to-create-an-internal-comment-on-a-jira-issue-using-the-jira-cloud-rest-api )

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) web_infrastructure labels Mar 1, 2022
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! Can you please add a changelog fragment? Thanks.

@Boosai Boosai requested a review from felixfontein March 2, 2022 08:22
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Should this also be mentioned in the documentation of the fields option?

changelogs/fragments/4304-jira-fields-in-comment.yml Outdated Show resolved Hide resolved
@felixfontein felixfontein added backport-4 check-before-release PR will be looked at again shortly before release and merged if possible. labels Mar 2, 2022
@Boosai
Copy link
Contributor Author

Boosai commented Mar 3, 2022

Should this also be mentioned in the documentation of the fields option?

Oh yes, I added some documentation there.

@Boosai
Copy link
Contributor Author

Boosai commented Mar 3, 2022

recheck

@Boosai Boosai requested a review from felixfontein March 3, 2022 11:17
Co-authored-by: Felix Fontein <felix@fontein.de>
@Boosai Boosai requested a review from felixfontein March 3, 2022 13:41
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Looks good to me. If nobody complains in say a week, I'll merge this.

@russoz
Copy link
Collaborator

russoz commented Mar 5, 2022

hi @Boosai thanks for the contribution. Has this code been tested somewhere? Assuming a yes, it would be nice to have that use case added to the integration tests.

@Boosai
Copy link
Contributor Author

Boosai commented Mar 7, 2022

Has this code been tested somewhere? Assuming a yes, it would be nice to have that use case added to the integration tests.

Hi @russoz, we tested it manually against Jira v8.20.1 with JIRA
Service Management Application v4.20.1 and Jira v8.11.0.

In order to test this via the module you would need to integrate further functions (2?) to get the property keys & property key values from the api. See https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issue-comment-properties/#api-group-issue-comment-properties
If this functionality is generally needed it would be implementable. I don't know if this would be in scope.

What do you think?

@felixfontein
Copy link
Collaborator

@russoz what do you think? To me it sounds like this should be merged as-is.

@russoz
Copy link
Collaborator

russoz commented Mar 12, 2022

@felixfontein yup, I think we can merge it.

@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Mar 12, 2022
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Mar 12, 2022
@felixfontein felixfontein merged commit 4fbba96 into ansible-collections:main Mar 12, 2022
@patchback
Copy link

patchback bot commented Mar 12, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/4fbba96841b6942e86e44915536f3e4d06fbb40a/pr-4304

Backported as #4347

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 12, 2022
* jira: Use fields in comment to merge in additional data

* changlog fragment added

* Update changelogs/fragments/4304-jira-fields-in-comment.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* updated fields documentation

* Update plugins/modules/web_infrastructure/jira.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4fbba96)
@felixfontein
Copy link
Collaborator

@Boosai thanks for your contribution!
@russoz thanks for reviewing!

felixfontein pushed a commit that referenced this pull request Mar 12, 2022
* jira: Use fields in comment to merge in additional data

* changlog fragment added

* Update changelogs/fragments/4304-jira-fields-in-comment.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* updated fields documentation

* Update plugins/modules/web_infrastructure/jira.py

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4fbba96)

Co-authored-by: Boosai <51994151+Boosai@users.noreply.github.com>
@Boosai Boosai deleted the jira_merge_fields_in_comment branch March 16, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module new_contributor Help guide this first time contributor plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging web_infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants