Skip to content

Add audit events when an issue is updated by project access token

Huzaifa Iftikhar requested to merge 323299_audit_token_activity_for_issues into master

What does this MR do and why?

Add audit events when an issue, incident, test case or epic is created, closed, reopened by a project or group access token.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Issue Incident Test Case Epic
image image image image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Create a project and then create a project access token for that project as per the steps in this doc.
  2. Create an issue using the issues API with the above project access token. Example: curl -X POST --header "PRIVATE-TOKEN: <insert-token-here>" "https://gdk.test:3000/api/v4/projects/20/issues?title=This+is+a+test+note&issue_type=issue".
  3. Ensure that a project audit event is created.
  4. Close the above issue using the API. Example curl -X POST --header "PRIVATE-TOKEN: <insert-token-here>" "https://gdk.test:3000/api/v4/projects/20/issues/:iid?state_event=close"
  5. Ensure that a project audit event is created.
  6. Reopen the above issue using the API. Example curl -X POST --header "PRIVATE-TOKEN: <insert-token-here>" "https://gdk.test:3000/api/v4/projects/20/issues/:iid?state_event=reopen"
  7. Ensure that a project audit event is created.
  8. Repeat the above steps 2-7 for different values of issue_type i.e. incident and test_case.
  9. Create a group and then create a group access token for that group as per the steps in this doc
  10. Create an epic inside the group using the epics API using the above group access token. Example: curl -X POST --header "PRIVATE-TOKEN: <insert-token-here>" "https://gdk.test:3000/api/v4/groups/31/epics?title=This+is+a+test+note".
  11. Ensure that a group audit event is created.
  12. Close the above epic using the API. Example curl -X POST --header "PRIVATE-TOKEN: <insert-token-here>" "https://gdk.test:3000/api/v4/groups/31/epics/9?state_event=close"
  13. Ensure that a group audit event is created.
  14. Reopen the above epic using the API. Example curl -X POST --header "PRIVATE-TOKEN: <insert-token-here>" "https://gdk.test:3000/api/v4/groups/31/epics/9?state_event=reopen"
  15. Ensure that a group audit event is created.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Resolves #323299 (closed)

Edited by Huzaifa Iftikhar

Merge request reports