question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Long story short, I’m trying to write my own Asana/iDoneThis integration.

I’ve got as far as passing Asana’s completed tasks to iDoneThis, and now I want to set a custom field to use to exclude these from future sweeps.

Here’s my code, but it doesn’t seem to be adding the ‘external’ data:

tasks is the array of tasks.

tasks.forEach(function (task) {
            var extStr = JSON.stringify({
                "id": task.id,
                "data": 'passedToIDT'
            });
            var data = {
              notes: task.notes ? task.notes + '\nDone...' : 'Done...',
              external: extStr
            }
            client.tasks.update(task.id, data)
            .then(function (resp) {
                console.log(resp);
            });
        });

I get ‘Unhandled rejection Error: Server Error’ when running the code as above.

I also tried JSON.stringify(data) as the second argument to the update method, but that just did nothing (there was no error, but the external data was not set).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
joeinnescommented, Aug 4, 2016

I was on Oauth, but should have thought about it more carefully and added the .catch() myself. Anyway, it told me that the ID needs to be a string. Coerced it, and now working beautifully. Thanks for all your help!

0reactions
slobakcommented, Aug 4, 2016

Another thought (from @praecipula) is that you may not have initialized your client with Oauth? External data is per-Oauth-app. But if you don’t use Oauth, you cannot use the feature. Either way, the error message you’re getting should be more revealing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Windows Update errors - Microsoft Support
This guided walk-through provides steps to fix problems with Windows Updates for Windows 8.1 and 7, such as taking a long time to...
Read more >
7 Ways To Fix Windows Update Errors If They Failed - Action1
How to Fix Update Error · 1. Restart the Computer and Run Windows Update Again · 2. Check for Driver or Hardware Conflict...
Read more >
Fix Chrome update problems & failed updates - Google Support
If you're having problems updating Chrome on your computer, you might see: Update failed: Updates are disabled by administrator; Update failed (Error: 3...
Read more >
What to Do When Windows Update Keeps Failing on ...
Methods to fix Windows Update failing errors · Run the Windows Update Troubleshooter tool · Restart Windows Update related services · Run the...
Read more >
iOS update and restore errors - Apple Support
Update the software on your Mac or PC. If you see error 10, your iOS device might have a newer version of iOS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found