Upload attachment for every task in project

Hi,

I’m just starting out with Asana API and looking for some advice on which approach to take. Apologies if this has already been covered elsewhere.

What I want to do is get the names of all tasks in a project, check a directory for files with matching names, and upload the files as attachments to each task. New tasks won’t be added often, so I don’t NEED it to trigger automatically.

Any advice on getting started? Should I go direct to the API or use an integration?

Further info that may be relevant.

The Project is a BOM. Each task is a part number. I’m primarily interested in uploading an image/thumbnail for easy identification of the part. I might also upload drawings, though I’d then need a way of checking versions for when they are updated.

The script doesn’t need to high availability/accessibility etc. If I manually run it on my workstation that’s enough for now (not sure where the company will head with BOMs long term).

Most of my scripting experience is VBA for Excel and Solidworks. I haven’t done anything with web apps. If I need to choose a different language, I’m considering C# since I have some experience with it and it supports the Solidworks API. However, I’m open to other suggestions.

Welcome to the forum, @Caleb_Pearce! I think your general approach would be:

  • Get all tasks from your project
  • Processing all those task names and matching against your external db
  • Uploading attachments based on your business logic

For a simple script like this that you plan to run locally, you probably just need to intake a project GID to feed into step 1 (can do this intake manually). As far as language goes, that’s a fully personal preference (is there a reason you would need to connect this script to Solidworks? Is that where your db of part images is stored?). Asana has python and JS client libraries (also Ruby, Java, PHP?) that you can find here. You could certainly use C# but you’d have to forgo the libraries (totally fine, just a bit more effort).

1 Like

Thanks so much @Stephen_Li ! That’s just what I needed to get me started.

There’s no reason this particular script needs to connect to SolidWorks. I can see benefits for connecting other scripts in the future. For example, I could allow an update of the “Preferred Vendor” custom field in Asana to be pushed back into Solidworks which is currently our primary data source.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.