Skip to content

Instantly share code, notes, and snippets.

@keeganbrown
Last active June 14, 2018 22:47
Show Gist options
  • Save keeganbrown/226a37e7f386887ccf0ce938e025086c to your computer and use it in GitHub Desktop.
Save keeganbrown/226a37e7f386887ccf0ce938e025086c to your computer and use it in GitHub Desktop.

Revisions

  1. keeganbrown revised this gist Jun 14, 2018. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions bulk-apply-stage-to-wrike-tasks.js
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,7 @@
    // To be executed from a task overlay, with subtasks shown.
    $('a[wrike-task-view-row-info-plate]')
    .map((i, ele) => ele.href.replace('https://www.wrike.com/open.htm?id=',''))
    .each((i, ele) => {
    if (i > 1) return;
    .map((i, ele) => {
    var eleid = ele.href.replace('https://www.wrike.com/open.htm?id=','');

    $.ajax({
    url: '/ui/batch_task_save',
    @@ -12,7 +11,7 @@ $('a[wrike-task-view-row-info-plate]')
    'x-w-client': 'app:workspace;ver:35.22.0-78312'
    },
    data: {
    entries: `[{"data":'{"stageId":[numerical id of the stage],"id":"${ele}","accountId":"[your account id]"}',"accountId":"[your account id again]","isAutomatedAction":false}]`,
    entries: `[{"data":'{"stageId":[numerical id of the stage],"id":"${eleid}","accountId":"[your account id]"}',"accountId":"[your account id again]","isAutomatedAction":false}]`,
    total: 1
    },
    complete: (a,b,c) => {
  2. keeganbrown created this gist Jun 14, 2018.
    22 changes: 22 additions & 0 deletions bulk-apply-stage-to-wrike-tasks.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    // To be executed from a task overlay, with subtasks shown.
    $('a[wrike-task-view-row-info-plate]')
    .map((i, ele) => ele.href.replace('https://www.wrike.com/open.htm?id=',''))
    .each((i, ele) => {
    if (i > 1) return;

    $.ajax({
    url: '/ui/batch_task_save',
    method: 'POST',
    headers: {
    'wrike-client-id': 'web-[your wrike id here]',
    'x-w-client': 'app:workspace;ver:35.22.0-78312'
    },
    data: {
    entries: `[{"data":'{"stageId":[numerical id of the stage],"id":"${ele}","accountId":"[your account id]"}',"accountId":"[your account id again]","isAutomatedAction":false}]`,
    total: 1
    },
    complete: (a,b,c) => {
    console.log(a,b,c);
    }
    })
    });