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.
bulk-apply-stage-to-wrike-tasks.js
// To be executed from a task overlay, with subtasks shown.
$('a[wrike-task-view-row-info-plate]')
.map((i, ele) => {
var eleid = ele.href.replace('https://www.wrike.com/open.htm?id=','');
$.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":"${eleid}","accountId":"[your account id]"}',"accountId":"[your account id again]","isAutomatedAction":false}]`,
total: 1
},
complete: (a,b,c) => {
console.log(a,b,c);
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment