In addition to migraine prevention, amitriptyline is also used to treat other chronic pain conditions, anxiety, and irritable bowel syndrome (IBS), but its main job is to treat depression.