Skip to content

Commit

Permalink
Merge pull request #40 from rsjazz/support_creationdate
Browse files Browse the repository at this point in the history
Support setting creationDate on initial creation.
  • Loading branch information
rsjazz authored Oct 7, 2022
2 parents 9443d17 + 0a70b35 commit d668901
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 64 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# EWM/RTC Work Item Command Line

Work Item Command Line Version 5.3.1
Work Item Command Line Version 6.0

See the [Prerequisites](https://github.com/jazz-community/work-item-command-line/blob/master/README.md#prerequisites) and [Work Item Command Line 5.0](https://rsjazz.wordpress.com/2019/07/03/work-item-command-line-5-0/) for instructions how to setup and install WCL.

Latest changes: Version 6.0 removes Log4J1 and adds Log4J2. The changes break compatibility to releases before 7.0.2SR1

**License**

This software is licensed under the MIT license which is as follows: [MIT License](com.ibm.js.team.workitem.commandline/LICENSE.txt)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-create /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; workItemType=task summary=&quot;Created Without Category&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/main/java/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="com.ibm.js.team.workitem.commandline"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-create /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; workItemType=task summary=&quot;Created Without Category&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/main/java/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="com.ibm.js.team.workitem.commandline"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-create /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=deb password=deb projectArea=&quot;JKE Banking (Change Management)&quot; workItemType=task summary=&quot;New Item CreationDate&quot; category=JKE owner=ralph target=&quot;Main Development/Release 1.0/Sprint 3&quot; internalSeverity=Major foundIn=&quot;Sprint 2 Development&quot; internalPriority=High creator=myadmin creationDate:set=&quot;2015/02/01 12:30:00 GMT+01:00&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/main/java/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="com.ibm.js.team.workitem.commandline"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-create /ignoreErrors repository=&quot;https://localhost:9443/ccm&quot; user=myadmin password=myadmin projectArea=&quot;Test&quot; workItemType=task summary=&quot;New Item&quot; category=Test owner=myadmin internalPriority=High creator=myadmin"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-create /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=deb password=deb projectArea=&quot;JKE Banking (Change Management)&quot; workItemType=task summary=&quot;New Item&quot; category=JKE owner=ralph target=&quot;Main Development/Release 1.0/Sprint 3&quot; internalSeverity=Major foundIn=&quot;Sprint 2 Development&quot; internalPriority=High creator=myadmin"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="com.ibm.js.team.workitem.commandline"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-create /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=deb password=deb projectArea=&quot;JKE Banking (Change Management)&quot; workItemType=task summary=&quot;New Item CreationDate&quot; category=JKE owner=ralph target=&quot;Main Development/Release 1.0/Sprint 3&quot; internalSeverity=Major foundIn=&quot;Sprint 2 Development&quot; internalPriority=High creator=myadmin"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-export /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; exportFile=&quot;c:\aaTemp\export\Import633.csv&quot; query=&quot;633&quot; delimiter=&quot;;&quot; /allColumns"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-exportworkitems /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; exportFile=&quot;c:\aaTemp\export\Import633.csv&quot; query=&quot;633&quot; delimiter=&quot;;&quot; /allColumns"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/main/java/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-exportworkitems /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; exportFile=&quot;c:\aaTemp\export\export90.csv&quot; query=&quot;90&quot; delimiter=&quot;;&quot; /allColumns"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
<listEntry value="/com.ibm.js.team.workitem.commandline/src/main/java/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-export /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; exportFile=&quot;c:\aaTemp\export\exportEx.csv&quot; query=&quot;All&quot; delimiter=&quot;;&quot; /allColumns"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-exportworkitems /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; exportFile=&quot;c:\aaTemp\export\exportEx.csv&quot; query=&quot;All&quot; delimiter=&quot;;&quot; /allColumns"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-exportworkitems /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=myadmin password=myadmin projectArea=&quot;JKE Banking (Change Management)&quot; exportFile=&quot;C:\Temp\RTCExport\Test.csv&quot; query=&quot;First&quot; columns=&quot;category,workItemType,internalState,internalPriority,internalSeverity,summary,owner,creator,description,dueDate,duration,foundIn,parent,child,tracks_workitem,contributes_to_workitem&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-exportworkitems /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=myadmin password=myadmin projectArea=&quot;JKE Banking (Change Management)&quot; exportFile=&quot;C:\Temp\RTCExport\Test.csv&quot; query=&quot;First&quot; columns=&quot;category,workItemType,internalState,internalPriority,internalSeverity,summary,owner,creator,creationDate,description,dueDate,duration,foundIn,parent,child,tracks_workitem,contributes_to_workitem&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
<listEntry value="/com.ibm.js.team.workitem.commandline/src/main/java/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-importworkitems /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; importFile=&quot;C:\aaTemp\Export\ResolutionTest.csv&quot; delimiter=&quot;;&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-importworkitems /ignoreErrors repository=&quot;https://clm.example.com:9443/ccm&quot; user=ralph password=ralph projectArea=&quot;JKE Banking (Change Management)&quot; importFile=&quot;C:\aaTemp\Export\import90.csv&quot; delimiter=&quot;;&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?><launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-validateoslclinks /trace /debug repository=&quot;https://jupiter:9543/ccm&quot; user=kirk password=kirk projectArea=&quot;Test A (Change Management)&quot; query=&quot;All&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/com.ibm.js.team.workitem.commandline/src/main/java/com/ibm/js/team/workitem/commandline/WorkitemCommandLine.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ibm.js.team.workitem.commandline.WorkitemCommandLine"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="com.ibm.js.team.workitem.commandline"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-validateoslclinks /trace /debug repository=&quot;https://jupiter:9543/ccm&quot; user=kirk password=kirk projectArea=&quot;Test A (Change Management)&quot; query=&quot;All&quot;"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.ibm.js.team.workitem.commandline"/>
</launchConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public interface IWorkItemCommandLineConstants {

public static final String VERSIONINFO = "5.3.1";
public static final String VERSIONINFO = "6.0";

// Commands available
public static final String COMMAND_CREATE = "create";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import java.util.HashMap;
import java.util.Set;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
import org.apache.logging.log4j.core.config.DefaultConfiguration;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;

Expand Down Expand Up @@ -174,9 +174,10 @@ private IWorkItemCommand getSupportedCommand(String commandName) {
*/
public static void main(String[] args) {
// The next two lines are needed to prevent error message from API
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.FATAL);

// This was ported from Log4j1 to Log4j2
Configurator.initialize(new DefaultConfiguration() );
Configurator.setRootLevel(Level.FATAL);

System.out.println("StartTime: " + DateFormat.getDateTimeInstance().format(new Date()));

OperationResult result = new OperationResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

import java.util.List;

import org.apache.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.ibm.js.team.workitem.commandline.IWorkItemCommandLineConstants;
import com.ibm.js.team.workitem.commandline.OperationResult;
Expand Down Expand Up @@ -40,8 +41,9 @@
*/
public class BulkUpdateWorkItemsCommand extends AbstractWorkItemModificationCommand {

private Logger logger = Logger.getLogger(BulkUpdateWorkItemsCommand.class);

// Get the logger. Changed for Log4J2
private static final Logger logger = LogManager.getLogger();

// To determine if we are in debug mode
private boolean fDebug;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,22 +829,22 @@ private void processAttribute(ColumnHeaderAttributeNameMapper headerMapping, Par
}
return;
}
// if (attribute.getIdentifier().equals(IWorkItem.CREATION_DATE_PROPERTY)) {
// // Ignore
// if(!isSuppressAttributeWarnings()){
// getResult().appendResultString("Ignored: Attribute is calculated and can not be set: " + attributeID
// + " mapped to: " + printAttribute(attribute));
// }
// return;
// }
// if (attribute.getIdentifier().equals(IWorkItem.CREATOR_PROPERTY)) {
// // Ignore
// if(!isSuppressAttributeWarnings()){
// getResult().appendResultString("Ignored: Attribute is calculated and can not be set: " + attributeID + " mapped to: " + printAttribute(attribute));
// }
// return;
// }
// Ignore attributes that can not be set
if (attribute.getIdentifier().equals(IWorkItem.CREATION_DATE_PROPERTY)) {
// Ignore
if(!isSuppressAttributeWarnings()){
getResult().appendResultString("Ignored: Attribute is calculated and can not be set: " + attributeID
+ " mapped to: " + printAttribute(attribute));
}
return;
}
if (attribute.getIdentifier().equals(IWorkItem.CREATOR_PROPERTY)) {
// Ignore
if(!isSuppressAttributeWarnings()){
getResult().appendResultString("Ignored: Attribute is calculated and can not be set: " + attributeID + " mapped to: " + printAttribute(attribute));
}
return;
}
if (attribute.getIdentifier().equals(IWorkItem.CUSTOM_ATTRIBUTES_PROPERTY)) {
// Ignore
if(!isSuppressAttributeWarnings()){
Expand Down
Loading

0 comments on commit d668901

Please sign in to comment.