Reusing the card layout

Certified Associate Developer

Hello Guys,
I am trying to move the story and its individual components from on phase to another. So in the diagram story is Go to School by tomorrow and its sub task are GTC task2 and GTC task 1. The problem is when I tried to move the story all its subtask are also moving and when I moved the subtask its not moving only the phase change is written in the database. I need to show the sub task below the story.
So I used below code to achieve also I think the problem is here. Can you please help me to solve this issue.
--rule!APM_bcklogItemCard calls the single story card.
--and I am again calling the APM_backlogItemandSubtask interface to get all the items on APM_backlog interface.

{
  rule!APM_backlogItemCard(
    onlyStory: ri!onlyStory,
    backlogItem: ri!backlogItem,
    showEditView: ri!showEditView,
    document: ri!document,
    selectedBacklogItem: ri!selectedBacklogItem,
    refresh: ri!refresh
  ), 
  if(
    ri!onlyStory,
    null,
    a!localVariables(
      local!data:a!refreshVariable(
        value: rule!APM_getBacklogItem(
        parentId: ri!backlogItem['recordType!{9b2f5c44-fe3f-4994-9b07-7f4384620bb8}APM Backlog Item.fields.{ca0b9965-3ee0-4649-81b1-825f9ee223d1}backlogItemId'],
      ),
      refreshOnVarChange: ri!refresh),
      a!forEach(
        items: local!data,
        expression: rule!APM_backlogItemCard(
          onlyStory: ri!onlyStory,
          backlogItem: fv!item,
          showEditView: ri!showEditView,
          document: ri!document,
          selectedBacklogItem: ri!selectedBacklogItem,
          refresh: ri!refresh
        )
      )
    )
  )
}

  Discussion posts and replies are publicly visible