Skip to content

[issue_tracker] Add ExternalIssueID field with permission control (#9795)#10254

Open
arnav-makkar wants to merge 1 commit intoaces:mainfrom
arnav-makkar:feature/9795-external-issue-id
Open

[issue_tracker] Add ExternalIssueID field with permission control (#9795)#10254
arnav-makkar wants to merge 1 commit intoaces:mainfrom
arnav-makkar:feature/9795-external-issue-id

Conversation

@arnav-makkar
Copy link
Copy Markdown
Contributor

@arnav-makkar arnav-makkar commented Jan 10, 2026

Brief summary of changes

This PR adds an External Issue ID field to the issue_tracker module, allowing administrators to link LORIS issues to external issue trackers (e.g., GitHub, Jira).

Key Features:

  • New externalIssueID field (varchar 255) in the issues table
  • Permission-based visibility and editing control via issue_tracker_external_id permission
  • Field changes tracked in issue history
  • Security: Backend validation prevents unauthorized edits via direct API calls

img

Implementation Details:

  • Database: Added column to issues table and updated issues_history enum

  • Backend: Permission checks in GET (hide field) and POST (validate edits) endpoints

  • Frontend: Conditional rendering and editing based on user permission

  • Migration: SQL patch for existing databases (2026-01-04-Add_ExternalIssueID_to_issues.sql)

  • Have you updated related documentation?

    • CHANGELOG.md updated
    • Test plan updated with 7 new test cases
    • Raisinbread test data updated

Link(s) to related issue(s)

@github-actions github-actions Bot added Language: SQL PR or issue that update SQL code RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset Language: PHP PR or issue that update PHP code Language: Javascript PR or issue that update Javascript code Module: issue_tracker PR or issue related to issue tracker module labels Jan 10, 2026
@CamilleBeau
Copy link
Copy Markdown
Collaborator

@arnav-makkar Can you fix the tests on this PR?

@arnav-makkar arnav-makkar force-pushed the feature/9795-external-issue-id branch from 790a6b2 to 24698a5 Compare January 20, 2026 06:29
@arnav-makkar
Copy link
Copy Markdown
Contributor Author

@CamilleBeau Fixed the linter errors in IssueForm.js that were causing the tests to fail.
Please review the changes and merge when free. Thank you!

@arnav-makkar
Copy link
Copy Markdown
Contributor Author

Hi @CamilleBeau, could you please review this PR?

ALTER TABLE `issues` ADD COLUMN `externalIssueID` varchar(255) DEFAULT NULL AFTER `description`;

-- Add permission to view/edit external issue ID
INSERT INTO `permissions` (code, description, moduleID, categoryID)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The new permission should be given to admin

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the feedback.
I've updated this SQL patch to grant the permission to the admin user now

@skarya22
Copy link
Copy Markdown
Contributor

@arnav-makkar could you fix the merge conflicts and then I will re-assign @CamilleBeau

@skarya22 skarya22 added the State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...) label Apr 21, 2026
@arnav-makkar arnav-makkar force-pushed the feature/9795-external-issue-id branch from 347fcf5 to 0ab37dd Compare April 21, 2026 19:54
@arnav-makkar
Copy link
Copy Markdown
Contributor Author

Hi @skarya22, since this branch was a few months old I've rebased onto current main and resolved the merge conflicts.
I've also made a few changes and re-ran the manual tests as follows.


Admin (has the permission)

Permission is granted on the admin account:
tick

The External Issue ID field renders on the Create New Issue form:
Screenshot 2026-04-22 at 01 54 31

Submitted an issue with a value in the field:
Screenshot 2026-04-22 at 01 56 05

On reopening, the value persists and the change is recorded in the comment history:
Screenshot 2026-04-22 at 01 55 31

Non-admin user (without issue_tracker_external_id)

Created a test user granted only the basic issue tracker permissions:
Screenshot 2026-04-22 at 02 03 34

The External Issue ID field does not render on the form:
Screenshot 2026-04-22 at 02 04 17

Please let me know if any additional verification is needed.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: Javascript PR or issue that update Javascript code Language: PHP PR or issue that update PHP code Language: SQL PR or issue that update SQL code Module: issue_tracker PR or issue related to issue tracker module RaisinBread PR or issue introducing/requiring improvements to the Raidinbread dataset State: Needs rebase PR that needs to be rebased to proceed (conflicts, wrong branch...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[issue_tracker] External Issue ID

3 participants