Jenkins to Teams script

Hi,

I am currently using the Office 365 Connector with a power automate flow. When the webhook changes I have to do a find and replace on the configs to update the urls. We have a few different webhooks with identical workflows so I was wondering if environment variables for each of the teams channels which feed into a single script on jenkins would be easier. That way i only have to update the environment variable and not all the configs.

I haven`t used scripts much in Jenkins so I was wondering if anyone has done anything like this before and if so how did you do it?

Thanks