Skip to main content
Skip table of contents

Update attributes of an environment

Script example to get an Environment and update its attributes.


package com.apwide.golive.example

import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.apwide.env.api.GoliveAccessor

GoliveAccessor goliveAccessor

final owner = "Fred"
final team = "Red Team"
final teamUrl = ""

def environments = goliveAccessor.golive().environments
def eCommerceStaging = environments.getByName("eCommerce Staging")

eCommerceStaging = eCommerceStaging.updateAttributes([
    "Team": """<a href="${teamUrl}">${team}</a>""",
    "Owner": owner,

return """
  Updated environment : ${eCommerceStaging},
  Team=${helper.getAttributeValue(eCommerceStaging, "Team")},
  Owner=${helper.getAttributeValue(eCommerceStaging, "Owner")}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.