Skip to content

Commit

Permalink
#337 - Option provided to append custom JQL while pulling worklogs. C…
Browse files Browse the repository at this point in the history
…an be used to filter the issues are add sorting to it
  • Loading branch information
shridhar-tl committed Dec 22, 2023
1 parent a9864b3 commit fda6d94
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"react-dnd": "^14.0.4",
"react-dnd-html5-backend": "^14.0.2",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.0",
"react-router-dom": "^6.21.1",
"react-scripts": "github:shridhar-tl/react-scripts",
"static-eval": "^2.1.0",
"zustand": "^4.4.7"
Expand All @@ -102,7 +102,7 @@
"@craco/craco": "^7.1.0",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"electron": "^28.0.0",
"electron": "^28.1.0",
"electron-builder": "^24.9.1",
"electronmon": "^2.0.2",
"eslint": "^8.56.0",
Expand Down
8 changes: 7 additions & 1 deletion src/services/worklog-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ export default class WorklogService extends BaseService {
listForQuery = `"${userList.join("\", \"")}"`;
}

const jql = `worklogAuthor in (${listForQuery}) and worklogDate >= '${mfromDate.clone().add(-1, 'days').format("YYYY-MM-DD")}' and worklogDate < '${mtoDate.clone().add(1, 'days').format("YYYY-MM-DD")}'`;
const worklogJQLSuffix = this.$session?.CurrentUser?.worklogJQLSuffix?.trim() || '';

if (worklogJQLSuffix) {
console.warn('Appended custom JQL to pull worklog information');
}

const jql = `worklogAuthor in (${listForQuery}) and worklogDate >= '${mfromDate.clone().add(-1, 'days').format("YYYY-MM-DD")}' and worklogDate < '${mtoDate.clone().add(1, 'days').format("YYYY-MM-DD")}' ${worklogJQLSuffix}`.trim();
if (!fields || fields.length === 0) {
fields = ["worklog"];
} //, "summary", "issuetype", "parent", "status", "assignee"
Expand Down
19 changes: 18 additions & 1 deletion src/views/settings/general/WorklogTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,27 @@ class WorklogTab extends TabControlBase {
<div className="ui-g-12 ui-md-9 ui-lg-9 ui-xl-10">
<div className="form-group">
<TicketNo value={settings.meetingTicket} field="meetingTicket" onChange={this.saveSetting} />
<span className="help-block">Provide the list of meeting tickets seperated by ',' for which you would add worklog</span>
<span className="help-block">Provide the list of meeting tickets separated by ',' for which you would add worklog</span>
</div>
</div>
</>}
<div className="form-label ui-g-12 ui-md-3 ui-lg-3 ui-xl-2">
<strong>Worklog JQL suffix while pulling worklogs</strong>
</div>
<div className="ui-g-12 ui-md-9 ui-lg-9 ui-xl-10">
<div className="form-group">
<TextBox value={settings.worklogJQLSuffix} field="worklogJQLSuffix"
maxLength={150} style={{ width: '100%', maxWidth: '500px' }}
onChange={this.saveSetting} />
<span className="help-block">
Appends this custom JQL while pulling issues list for worklog information.
<br />
For some Jira Cloud users, adding "ORDER BY updatedDate DESC" may solve performance issue while pulling worklogs.
<br />
<strong>Note:</strong> Do not use this field unless you know what exactly you are doing.
</span>
</div>
</div>
{/*<div className="form-label ui-g-12 ui-md-3 ui-lg-3 ui-xl-2">
<strong>Notify for missing worklog</strong>
</div>
Expand Down

0 comments on commit fda6d94

Please sign in to comment.