From a6d441500afa7622be4404f383ebc4113211604a Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Fri, 9 Sep 2022 14:42:43 -0500 Subject: [PATCH] add project URL, if present --- Linear.omnifocusjs/Resources/pull.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Linear.omnifocusjs/Resources/pull.js b/Linear.omnifocusjs/Resources/pull.js index 88ad65c..dfcce87 100644 --- a/Linear.omnifocusjs/Resources/pull.js +++ b/Linear.omnifocusjs/Resources/pull.js @@ -28,7 +28,7 @@ // Step 2: get the tasks // /////////////////////////// req.method = "POST"; - req.bodyString = '{"query":"{ viewer { assignedIssues(filter: {state: {type: {nin: [\\"completed\\",\\"canceled\\"]}}}) { nodes { identifier title url team { name } project { name } } } } }"}'; + req.bodyString = '{"query":"{ viewer { assignedIssues(filter: {state: {type: {nin: [\\"completed\\",\\"canceled\\"]}}}) { nodes { identifier title url team { name } project { name url } } } } }"}'; req.headers = { "Content-Type": "application/json", "Authorization": key, @@ -63,6 +63,13 @@ project.addTag(linearTag); project.containsSingletonActions = true; toFocus.push(project); + if (linearTask.project && project.note.indexOf(linearTask.project.url) === -1) { + if (project.note !== "") { + project.appendStringToNote(`\n\n${linearTask.project.url}`); + } else { + project.appendStringToNote(linearTask.project.url) + } + } let taskName = `${linearTask.identifier}: ${linearTask.title}`; let task = project.taskNamed(taskName) || new Task(taskName, project);