import com.urbancode.air.*
import com.urbancode.air.plugin.automation.*

final def apTool = new AirPluginTool(this.args[0], this.args[1])
final def props = apTool.getStepProperties()

final String serverUrl = props['automation/serverUrl']
final String serverUserName = props['automation/serverUserName']
final String serverPassword = props['automation/serverPassword']
final String tfsVersion = props['automation/tfsVersion']

final String workItemRegex = props['workItemRegex'] ?: ".*"
final String comment = props['comment']

AddComment ac = new AddComment()
ac.serverUrl = serverUrl
ac.serverUserName = serverUserName
ac.serverPassword = serverPassword
ac.tfsVersion = tfsVersion

ac.workItemRegex = workItemRegex
ac.comment = comment

ac.execute()