Skip to content

cloning a public story map with the 2.4.2 Python API, issues #2482

Description

@MSLTrebesch

So,

I'm attempting to clone a public story map to my ArcGIS Online org using clone_items.

I'm giving this a test on a public story map owned by Esri. Running this from a standard Notebook in ArcGIS Online using the 13.0 runtime (which has the 2.4.1 ArcGIS for Python API)

This is the public Story Map: https://storymaps.arcgis.com/stories/0f6f051fba32481cba12e8565e8681a0

Code seems to hang. I've tried to just clone the webmap that's within the Story Map, but that seems to hang too.

https://www.arcgis.com/apps/mapviewer/index.html?webmap=b5cebe00555444c08b13d15a00100b16

I thought clone items would copy what it needed, and Living Atlas layers and such would still be referenced?

Is there an issue with my code?

from arcgis.gis import GIS

-------------------------------------------------------------------

CONFIGURE THESE VALUES

-------------------------------------------------------------------

public_storymap_item_id = "0f6f051fba32481cba12e8565e8681a0" # replace with the public StoryMap item ID

target_folder = "test" # optional; set to None if you do not want a folder

-------------------------------------------------------------------

Connect anonymously to access the public source item

source_gis = GIS()

Connect to your ArcGIS Online organization

target_gis = GIS("home")

Get the public StoryMap item

source_item = source_gis.content.get(public_storymap_item_id)

if source_item is None:
raise ValueError("Could not find the public StoryMap item. Check the item ID.")
print(f"Source item found: {source_item.title} ({source_item.type})")

Clone the item into your organization

cloned_items = target_gis.content.clone_items(
items=[source_item],
folder=target_folder,
search_existing_items=True
)

Report results

if cloned_items:
cloned_item = cloned_items[0]
print("Clone completed.")
print(f"New item title: {cloned_item.title}")
print(f"New item ID: {cloned_item.id}")
print(f"New item URL: {cloned_item.homepage}")
else:
print("No cloned items were returned.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions