1

Could some one please tell me Is there any way to create a Task/Change Request/Work Package in MKS Integrity using Java API?

We have an xml file with all the details about Task. By taking this as Input, need to generate a Task/Change Request/Work Package.

Monika
  • 325
  • 1
  • 2
  • 9

2 Answers2

1

The Integrity Java API is basically a structured command line interface, so if you can construct a standard Integrity command (with parameters & options) to create the item, you can easily use the API to create the item also. NOTE: This works for most commands, but not all.

For example:

If your command line is:

im createissue --type=Task --State=Submitted --field=Summary="Test summary"

You could do the same with the following code:

Command cmd = new Command(Command.IM, "createissue");
cmd.addOption(new Option("type", "Task"));
cmd.addOption(new Option("state", "Submitted");
MultiValue mv = new MultiValue("=");
mv.add("Summary");
mv.add("Test Summary");
cmd.addOption("field", mv);

Then run the command using a CommandRunner.

You can get more assitance in the PTC Integrity community site (https://www.ptcusercommunity.com/community/integrity).

David G
  • 3,940
  • 1
  • 22
  • 30
  • Is there any way can we give xml as input which contain all these details directly? or do we have to fetch from xml file and then supply parameters? @david – Monika Nov 25 '15 at 09:14
  • 1
    The Integrity Java API doesn't support loading parameters from an external file. The only way is to build the command using methods from "COmmand" object or you could use command as string – vasilenicusor Nov 25 '15 at 14:38
  • @vasilenicusor is correct, you'll need to write your own parser to transform the XML to Api calls. – David G Nov 25 '15 at 19:52
0

You can create the Task by using the below command line interface

 im createissue --type=Task --field=State=Submitted --field=Summary="Test summary"

The type field specifies the issue type to create. Your administrator defines issue types and this option is mandatory.

DevChamp
  • 1
  • 1