Skip to content

Commit

Permalink
Merge branch 'action-item-exports' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Tethik committed Jan 24, 2024
2 parents d8245f3 + c015a4e commit 85e1c29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion QuickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ docker compose up -d
Then build and try to run the project

```sh
npm run dev # note: you'll need to restart this process if you make an backend changes
npm run dev # note: you'll need to restart this process if you make backend changes
```

## First Login
Expand Down
11 changes: 8 additions & 3 deletions plugins/jira/src/JiraActionItemExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ const log = log4js.getLogger("JiraActionItemExporter");

export interface JiraActionItemExporterConfig extends JiraConfig {
/**
* If "reviewer-as-reporter", the reporter will be set to the user that created the review.'
* If "jira-token-user", the reporter will be set to the user that the Jira API token belongs to.
* If "reviewer-as-reporter", the reporter will be set to the user that created the review.' Ensure that the token user has the global permission:
* `Browse users and groups`.
* If "jira-token-user", the reporter will always be set to the user that the Jira API token belongs to.
*/
reporterMode: "reviewer-as-reporter" | "jira-token-user";

Expand Down Expand Up @@ -163,7 +164,11 @@ export class JiraActionItemExporter implements ActionItemExporter {
);

if (!review) {
throw new Error(`Could not find review for model ${actionItem.modelId}`);
// Fall back to token user if no reviewer is assigned
log.info(
`Could not find review for model ${actionItem.modelId}, using token user as reporter`
);
return { id: await this.getAccountIdCurrentUser() };
}

return { id: await this.getAccountIdForEmail(review.reviewedBy) };
Expand Down

0 comments on commit 85e1c29

Please sign in to comment.