Hello everyone,
We recently faced a problem with a coworker. We would like to add tags on existing services so we used the classic method :
tags = item.tags
tags.append("test_tag")
item.update(item_properties={'test_tag': tags})
And it worked perfectly, we can see the new tag in the portal :

But when we checked in the AGS Manager Tool or in the API REST, we cannot see the new tag we added :
API REST :
ArcGIS Manager :

We had the idea to connect to the AGS and not to the portal and change the item's properties with this code :
new_tag = "test_tag"
admin_username = "username"
admin_password = "password"
server_url = 'https://domain/rest/services/unit_test/unit_test_service.MapServer'
properties_url = f"{server_url}/info/iteminfo?f=json"
response = requests.get(properties_url, auth=(
admin_username,
admin_password
))
service_info = response.json()
current_tags = service_info.get("tags", "")
update_tags = f"{current_tags}, {new_tag}" if current_tags else new_tag
update_url = f"{server_url}/edit?f=json"
update_payload = {"tags": update_tags}
response = requests.post(update_url, data=update_payload,
auth=(admin_username,
admin_password))
but it does not worker either.
We also thought about changing item properties via the following method :
gis.admin.servers.list()
so we can get server properties, services, item etc, but as you can probably imagine, it did not work either.
We don't konw if it is a bug or if there is something we missed.
Hope you can help us.
Best regards