Skip to content

StoryMap cloning preserving_item_id not respected #2417

@MathieuLegault1

Description

@MathieuLegault1

Describe the bug
Hello,

When cloning a StoryMap the parameter preserving_item_id parameter is not respected. Even if I specify I set it to True it will get a new id.

When looking at the documentation I see this:

Optional string. Available in ArcGIS Enterprise 10.8.1+. Not available in ArcGIS Online.

but the code does this (_impl/common/_itemdef/_storymaps):

if self._preserve_item_id and self.target._portal.is_arcgisonline:
    item_id = self.portal_item.itemid

I believe this is an error because while looking at the other part of the code I see this:

if self._preserve_item_id and self.target._portal.is_arcgisonline == False:
    item_id = self.portal_item.itemid

Is it possible that it should be == False instead ?

To Reproduce
Steps to reproduce the behavior:

gis.content.clone_items(
    items=[item],
    copy_data=True,
    copy_global_ids=True,
    owner=user,
    preserve_item_id=True,
    preserve_editing_info=True,
    copy_code_attachment=True,
)

Error:
Item has a new id instead of the old one

Expected behavior
The item should have the same id as the copied item.

Platform (please complete the following information):

  • OS: Windows 11 Enterprise
  • Python API Version: 2.4.2

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