what was its role in the second boer war?
They were a part of Battle of Talana Hill and Battle of Ladysmith
Gloucestershire Regiment
The Gloucestershire Regiment began life quietly. The two battalions alternated between postings at home and overseas, mostly in India, but their first action came in 1899 during the Second Boer War. Deployed to Ladysmith, the 1st Battalion was part of a column sent out on 24 October to cover the withdrawal of a brigade after the Battle of Talana Hill. When the column came under fire near Rietfontein, the battalion was detached and ordered forward, but the order was ambiguous and the battalion advanced too far. The troops were caught in the open for several hours before they were able to extricate themselves at the cost of five men killed, including the battalion commander, and 58 wounded.

Five days later, some 450 men of the 1st Battalion were part of a small force tasked with seizing Nicholson's Nek, a pass some north of Ladysmith, during the Battle of Ladysmith. 
what is gloucestershire regiment ? A line infantry regiment of the British Army when was it formed? 1694 what is its current status? The regiment followed the 28th and 61st Regiments of Foot into history
wiki:12489279
Gloucestershire Regiment [SEP] Second Boer War
The Gloucestershire Regiment began life quietly. The two battalions alternated between postings at home and overseas, mostly in India, but their first action came in 1899 during the Second Boer War. Deployed to Ladysmith, the 1st Battalion was part of a column sent out on 24 October to cover the withdrawal of a brigade after the Battle of Talana Hill. When the column came under fire near Rietfontein, the battalion was detached and ordered forward, but the order was ambiguous and the battalion advanced too far. The troops were caught in the open for several hours before they were able to extricate themselves at the cost of five men killed, including the battalion commander, and 58 wounded.