Skip to main content
1-Visitor
May 18, 2015
Solved

how to create relateditem with mks

  • May 18, 2015
  • 3 replies
  • 6095 views

Hallo,

i have a problem to create a SW-Subtask with im createissue.

I use the following commandline:

(1) im createissue --Field="Project=/XX/YY" --Field="SWI=ZZ" --Field="Summary='my summary" --Field="Assigned User=me" --type=SW-Subtask --Field="Observer=he"

Creating SW-Subtask ...

Editing fields ...

Submitting ...

Could not save item: Cannot change the state to IMPLEMENTATION:

There's no parent of type SW-Task.

Then i used the following commandline:

(2) im createissue --Field="Project=/XX/YY" --Field="SWI=ZZ" --Field="Summary='my summary" --Field="Assigned User=me" --type=SW-Subtask --Field="Observer=he" --Field="parent=196" (196 is the parent workitem ID)

I got :

Creating SW-Subtask ...

Editing fields ...

Submitting ...

Could not save item: bitIndex < 0: -951

Could you please provide to me the correct solution to create a workitem with a predifined parent?

Thanks and regards

Miled Attia

    Best answer by tketz

    Hi @all

    I'm the administrator of the integrity system at Attia's company.

    I solved his problem by explaining our Process-Model (Request->SW-Task->SW-Subtask) and give him the right Syntax:

    im createissue --type=SW-Subtask --field="Project=/MKS/MKS Test" --field=SWI=Undefined --field="Assigned User=xxx" --field=Observer=xxx --field=summary=testsub --addFieldValues="Backward Relationships=166286"

    where 166286 is the parent Item (SW-Task in correct state)

    Best Regards,

    Tobi

    3 replies

    16-Pearl
    May 19, 2015

    Hallo Miled,

    Do you have a stack trace from your server's server.log file? You might need to turn up DEBUG logging, but I don't think that will be necessary for this issue.

    Regards,

    Kael

    16-Pearl
    May 29, 2015

    Miled,

    Did you resolve this issue successfully, or are you still stuck?

    Regards,
    Kael

    21-Topaz I
    May 22, 2015

    If you are working with documents and content nodes, you will need to use slightly different commands. For example:

    rq createcontent --type=SW-Subtask --field="Assigned User=[username]" --field="Summary=My Summary" --field=SWI=ZZ --field=project=/XX/YY --parentID=[ID of node or document]


    mattia1-VisitorAuthor
    1-Visitor
    June 2, 2015

    Hi Joe,

    ich have tried to use this method, but i got the following error message.

    **** The Type "SW-Subtask" is not a node type.

    Regards

    Miled

    16-Pearl
    June 2, 2015

    In that case, the SW-Subtask type can't be created with rq createcontent.  The rq createcontent command only works with content (node) types.

    tketz1-VisitorAnswer
    1-Visitor
    June 3, 2015

    Hi @all

    I'm the administrator of the integrity system at Attia's company.

    I solved his problem by explaining our Process-Model (Request->SW-Task->SW-Subtask) and give him the right Syntax:

    im createissue --type=SW-Subtask --field="Project=/MKS/MKS Test" --field=SWI=Undefined --field="Assigned User=xxx" --field=Observer=xxx --field=summary=testsub --addFieldValues="Backward Relationships=166286"

    where 166286 is the parent Item (SW-Task in correct state)

    Best Regards,

    Tobi

    mattia1-VisitorAuthor
    1-Visitor
    June 3, 2015

    Thank you all for your Help and for the quick Reply!!