# Getting an Asana task ID from the task URL for automation

## TL;DR

For commit hooks or scripts referencing Asana tasks, parse the ID out of the full task URL instead of hand-copying it. Better yet, store the whole URL in the commit message so humans get a clickable link and machines can extract the ID from the same string. Context: Stack Overflow #21393264 (accepted answer, 8 votes): the asker was building a git commit hook that comments on Asana tasks and found task IDs long, cumbersome, and only visible in the task URL.

Use this when you run into the situation in the title.

**When not to use this skill:** unrelated tasks. It covers only the procedure above.

## Compatibility

The steps above apply to the commands named in them. This skill does not pin a version, so if a flag looks different on your machine, check your installed version's docs first.

## Details

The accepted answer says to stop copying bare IDs entirely: paste the full task link instead. The link contains the ID for the hook to extract, it identifies the task as an Asana task, and it is clickable in commit history so the link works in both directions.
