He had a good command of Persian and could speak directly with the local people.
Career
Rattray began his career as a soldier. He was commissioned as a 2nd Lieutenant on 5 Dec 1838, the date he sailed out of Gravesend on the Severn, a West Indiaman bound for India. This ship was abandoned at sea later that same year on 29 December 1838, with 16 ft. of water in her hold on a voyage from Miramichi in Canada for Bristol. He followed and served alongside Charles Rattray, his older brother by 8 years, who was a Captain in the same period in Afghanistan. He spent some time in the Hindustan. Rattray was part of a combined force known as the Army of the Indus. He was a Lieutenant in the 2nd Grenadiers, Bengal Army. He took part in the First Anglo-Afghan War, from 1839 to 1842. He was in Ghazni in 1839–40. The picture, right, depicts the final resting place of Mahmud of Ghazni. The artist in Rattray was in love with this particular spot and viewed it as one of the most charming places in Afghanistan. His brother, Lieutenant Charles Rattray, 20th N.I. acting as Major Eldred Pottinger's assistant, was assassinated on 3 November 1841 on duty at Lughmani, near Charikar, in the Kabul valley. James was in Khandahar in December 1841 He helped man the rearguard during the army's 1842 retreat from Kabul from Kabul to Peshawar. They entered the Khyber Pass from Jamrud. Their mission to take the fortress of Ali Masjid, popularly known as the Key of the Pass, which dominated the road and was garrisoned by Dost Mohammed's troops. Rattray had scarcely completed sketching, "when suddenly a report was heard, and, to my utter astonishment, walls and bastions composing the fortress blew up simultaneously in the air, like a whirlwind of sand; and so completely was it swept off from the summit of the mountain, that when the dense cloud cleared away not a vestige of the building remained." Rattray undertook several tours of the region, after leaving the Army. Another brother Captain Thomas Rattray raised the 1stBengal Military Police Battalion in April 1856, at Lahore, later re-named the 45th Rattray's Sikhs.
Death
He died on 24 October 1854, at age 36, at Dorundah, Nagpore, India. On his death he was a Captain in the Indian Army. He died a bachelor, leaving no heirs. The executor of his estate was his brother Major David Rattray of the Devonshire Militia, residing in Tiverton, Devon.
He is the author of Scenery, Inhabitants & Costumes, of Afghaunistaun from drawings made on the spot by James Rattray. Artist: James Rattray 1818–1854, Lithographer: Robert Carrick, Published by Day & Son in 1847. A second edition was published the next year in London: by Hering & Remington, 137 Regent street, 1848. The artist dedicated this collection to the Kandahar Force that he belonged under the command of Major-General Sir William Nott,G.C.B., and the British and Indian Army officers who participated in the war. His sketches and drawings were made into Lithographs mainly by the lithographer and engraver Robert C. Carrick. Other lithographers were Edmund Walker Plate nos. 2, 19, 20, 22, 24, and 25; landscape artist and lithographer William L. Walton Plate nos. 13 and 18, and Plate no. 21 by Frederick William Hulme, all employed by the publisher. W. L. Walton was a landscape artist, working in London, who exhibited between 1834 and 1855. He also made the lithographic plates for General Sale's Defence of Jalalabad. Among the subscribers for the publication were Prince Albert, and several Rattray family members, including Capt. Charles Rattray, Pol. Agt., Turkestan; Capt. Rattray R.N.; Capt. D. Rattray, Prince Albert's Light Infantry; Lieut. T. Rattray, BNI. Each colour plate is accompanied by a lengthy explanatory texts, delving into detailed vivid depictions of the people, their clothing, habits, occupations. Topics relating to historical and ethnohistorical interest are described, such as the forms of worship at tombs and mosques, and the imperial rituals of the Dorranis. Verbatim excerpts of some of these texts can be found on the British Library website.