Monika
Monika

Reputation: 325

How to create a task in Integrity using Java API

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.

Upvotes: 1

Views: 2317

Answers (2)

DevChamp
DevChamp

Reputation: 1

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.

Upvotes: 0

David G
David G

Reputation: 4014

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).

Upvotes: 1

Related Questions