It's all about the answers!

Ask a question

how to get the workitem ID in RTC


Ananya Joisa (4552124) | asked Apr 12 '12, 6:04 a.m.
Hi guys,

I am trying to automatically run a script when a workitem is saved in RTC. Is this possible? Can I customize the 'Save' button of a workitem in RTC? I am using build system toolkit to run the script.

I was thinking if I get the workitem ID(the unique number for every workitem), then I will be able to associate it to the build ID(of the build definition that is running my script). But I am not able to figure out how to get the workitem ID.

Please suggest.

Any other ideas?

Thanks,
Ananya

Accepted answer


permanent link
Scott Crouch (48532326) | answered Apr 14 '12, 2:44 p.m.
An example article at https://jazz.net/library/article/634 talks about how to create an on save action that evaluates the state and then triggers a build if necessary.
Ananya Joisa selected this answer as the correct answer

18 other answers



permanent link
Ralph Schoon (63.1k33645) | answered Apr 25 '12, 4:35 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

for older versions of RTC it was just a line so you had to follow:

__a. Find the following line that starts with the following. It is near the bottom of the file. Note that the line is much longer than this. You should turn off word wrap.

and add the statements to this line.

In the newer versions, you have to follow the pattern and add a set statement.

setlocal
set JAVA_OPTS=%JAVA_OPTS% -Djava.awt.headless=true
set JAVA_OPTS=%JAVA_OPTS% -Xdebug
set JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=3388
set JAVA_OPTS=%JAVA_OPTS% -DSQLSERVER_JDBC="%SQLSERVER_JDBC%"
set JAVA_OPTS=%JAVA_OPTS% -DSQLSERVER_JDBC_DRIVER_FILE="%SQLSERVER_JDBC_DRIVER_FILE%"
set JAVA_OPTS=%JAVA_OPTS% -DORACLE_JDBC="%ORACLE_JDBC%"
set JAVA_OPTS=%JAVA_OPTS% -DORACLE_JDBC_DRIVER_FILE="%ORACLE_JDBC_DRIVER_FILE%"
set JAVA_OPTS=%JAVA_OPTS% -DDB2I_JDBC="%DB2I_JDBC%"
set JAVA_OPTS=%JAVA_OPTS% -DDB2Z_JDBC="%DB2Z_JDBC%"


If you don't turn off word wrap or add:

setlocal
set JAVA_OPTS=%JAVA_OPTS% -Djava.awt.headless=true
JAVA_OPTS=%JAVA_OPTS% -Xdebug
JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=3388
set JAVA_OPTS=%JAVA_OPTS% -DSQLSERVER_JDBC="%SQLSERVER_JDBC%"

the commandline obviously tries to run a command that is not there....

We have to look into fixing this in the next update of the workshop.

permanent link
Ralph Schoon (63.1k33645) | answered Apr 26 '12, 5:15 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Linux you might have to use repotools-jts.sh.

Please check if the commands are available, their extension and their permissions especially x to execute.

permanent link
Ralph Schoon (63.1k33645) | answered Apr 26 '12, 5:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
On Linux you might have to use repotools-jts.sh.

Please check if the commands are available, their extension and their permissions especially x to execute.


try to run ./repotools-jts.sh ....

permanent link
Ananya Joisa (4552124) | answered Apr 25 '12, 4:18 a.m.
Thanks Scott.

I ran into this error while editing the server code as mentioned on Page 17 of the RTC Extension Workshop.

I have added the lines,

JAVA_OPTS=%JAVA_OPTS% -Xdebug
JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=3388

after the line
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
as mentioned int he document.

But when I run the server using the command ./server.startup, I run into the following error:

./server.startup: -Xdebug: not found
./server.startup: -Xrunjdwp:transport=dt_socket,server=y,suspend=n,addres
s=3: not found
./server.startup: 388: not found

Please suggest.

Thanks,
Ananya

permanent link
Ananya Joisa (4552124) | answered Apr 26 '12, 5:11 a.m.
Thanks Ralph.

I have the server setup now. I was running the command "repotools-jts -import fromFile=RTCExtensionsJTSRepository-30-yyyymmdd.tar" as shown in the document. I have replaced 'RTCExtensionsJTSRepository-30-yyyymmdd.tar' with 'RTCExtensionsJTSRepository-301-20110901.tar'

But I am running into the error "ksh: repotools-jts: not found"

Please suggest.

Thanks,
Ananya

permanent link
Ananya Joisa (4552124) | answered Apr 27 '12, 3:12 a.m.
Thanks Ralph. ./repotools-jts.sh... worked.

When I ran "repotools-jts -import fromFile=RTCExtensionsJTSRepository-301-20110901.tar" command, I ran into the below error :

2012-04-26 15:28:01,417 Importing "ChangeEvent" items...
2012-04-26 15:28:01,448 itemId= stateId= nsURI=com.ibm.team.repository typeName=ChangeEvent
com.ibm.team.repository.common.internal.marshal.MarshallingException: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Attribute name "geEvent" associated with an element type "By" must be followed by the ' = ' character.
at com.ibm.team.repository.common.internal.marshal.impl.EObjectMigrationMarshaller.demarshalInputStreamToObject(EObjectMigrationMarshaller.java:68)
at com.ibm.team.repository.migration.internal.service.MigrationService.getExportedItem(MigrationService.java:1013)
at com.ibm.team.repository.migration.internal.service.MigrationService.importItem(MigrationService.java:827)
at com.ibm.team.repository.migration.internal.service.AbstractMigrationService.importData(AbstractMigrationService.java:1006)
at com.ibm.team.repository.migration.internal.service.AbstractMigrationService.importRepositoryOptionalVerifyPreserve(AbstractMigrationService.java:841)
at com.ibm.team.repository.migration.internal.service.AbstractMigrationService.importRepositoryOptionalVerify(AbstractMigrationService.java:791)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:370)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:356)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
at $Proxy686.importRepositoryOptionalVerify(Unknown Source)
at com.ibm.team.repotools.commands.local.internal.ImportCommand.importData(ImportCommand.java:224)
at com.ibm.team.repotools.commands.local.internal.ImportCommand.execute(ImportCommand.java:150)
at com.ibm.team.repotools.command.AbstractCommand.execute(AbstractCommand.java:64)
at com.ibm.team.repotools.rcp.internal.RepositoryToolsApplication.run(RepositoryToolsApplication.java:736)
at com.ibm.team.repotools.rcp.internal.RepositoryToolsApplication.start(RepositoryToolsApplication.java:811)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by:
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Attribute name "geEvent" associated with an element type "By" must be followed by the ' = ' character.
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:201)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:180)
at com.ibm.team.repository.common.internal.marshal.impl.EObjectMigrationMarshaller.demarshalInputStreamToObject(EObjectMigrationMarshaller.java:65)
... 31 more
Caused by:
org.xml.sax.SAXParseException: Attribute name "geEvent" associated with an element type "By" must be followed by the ' = ' character.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:181)
... 33 more
2012-04-26 15:28:01,450 CRJAZ0227I Illegal character in octal number "0".
com.ibm.team.repository.common.internal.content.util.tar.TarException: CRJAZ0227I Illegal character in octal number "0".
at com.ibm.team.repository.common.internal.content.util.tar.TarInputStream.readOctal(TarInputStream.java:511)
at com.ibm.team.repository.common.internal.content.util.tar.TarInputStream.readLong(TarInputStream.java:490)
at com.ibm.team.repository.common.internal.content.util.tar.TarInputStream.verifyChecksum(TarInputStream.java:468)
at com.ibm.team.repository.common.internal.content.util.tar.TarInputStream.readEntry(TarInputStream.java:290)
at com.ibm.team.repository.common.internal.content.util.tar.TarInputStream.getNextEntry(TarInputStream.java:94)
at com.ibm.team.repository.migration.internal.service.AbstractMigrationService.importData(AbstractMigrationService.java:960)
at com.ibm.team.repository.migration.internal.service.AbstractMigrationService.importRepositoryOptionalVerifyPreserve(AbstractMigrationService.java:841)
at com.ibm.team.repository.migration.internal.service.AbstractMigrationService.importRepositoryOptionalVerify(AbstractMigrationService.java:791)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:370)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:356)
at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)
at $Proxy686.importRepositoryOptionalVerify(Unknown Source)
at com.ibm.team.repotools.commands.local.internal.ImportCommand.importData(ImportCommand.java:224)
at com.ibm.team.repotools.commands.local.internal.ImportCommand.execute(ImportCommand.java:150)
at com.ibm.team.repotools.command.AbstractCommand.execute(AbstractCommand.java:64)
at com.ibm.team.repotools.rcp.internal.RepositoryToolsApplication.run(RepositoryToolsApplication.java:736)
at com.ibm.team.repotools.rcp.internal.RepositoryToolsApplication.start(RepositoryToolsApplication.java:811)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
2012-04-26 15:28:01,451 Imported 2 ChangeEvent items, 2 item states in 319 ms.
2012-04-26 15:28:01,451 CRJAZ0644I Error importing 1 ChangeEvent items, 1 item states.
2012-04-26 15:28:01,451 Average time to process an item state: 106 ms.
2012-04-26 15:28:01,451

Imported 2 items, 2 item states in 22999 ms. 0 item states skipped. Error importing 1 elements.
2012-04-26 15:28:24,128 Total time spent writing to the blackboard: 0 ms.
2012-04-26 15:28:24,128 Total time spent reading from the blackboard: 23 ms.
2012-04-26 15:28:24,128 com.ibm.team.repository
2012-04-26 15:28:24,128 ChangeEvent : 2 items, 2 item states imported.
2012-04-26 15:28:24,128
2012-04-26 15:28:24,128
2012-04-26 15:28:24,128 ##############################################################################################
2012-04-26 15:28:24,129 ****** Migration Errors ******
2012-04-26 15:28:24,129 CRJAZ0656I **ERROR** Migration completed with errors. The imported database is in an inconsistent state and should not be used without further analysis.
Check the migration log "/opt/IBM/JazzTeamServer/server/repotools-jts_import.log" for details.
2012-04-26 15:28:24,129 ##############################################################################################
2012-04-26 15:28:24,129 The user "ADMIN" has logged out of the database "conf/jts/derby/repositoryDB".

I am using the Derby database that came along with RTC. Since the tar file is around 3.6MB which is pretty huge should I use any other database(DB2)?

Please suggest.

Thanks,
Ananya

permanent link
Ananya Joisa (4552124) | answered Apr 27 '12, 3:16 a.m.
Sorry about the mistake in the previous comment. The command I ran was "./repotools-jts.sh -import fromFile=RTCExtensionsJTSRepository-301-20110901.tar".

permanent link
Ralph Schoon (63.1k33645) | answered Apr 27 '12, 3:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
No, Derby is fine. I have not seen any feedback that indicates the files on the server are broken. So I assume you have a corrupted download or something went wrong when you copied the files to Linux. Try to download the files again. Which workshop did you download and which Version of CLM are you using?

permanent link
Ananya Joisa (4552124) | answered May 03 '12, 5:50 a.m.
Thanks Ralph. The repotools commands ran fine.

I have another question. My server is installed in a Linux machine unlike how it is installed in Windows according to the document.

Document link: https://jazz.net/library/content/articles/rtc/3.0.1/extensions-workshop/RTC301ExtPoT.pdf

In a few steps I need to import files from the server folders in Linux to the RTC client in Windows.

In page 25, I need to copy services.xml and scr.xml from '\JazzTeamServer\server\conf\ccm' folder and copy it to 'conf\jazz' folder in the RTC Extension Workshop Configuration project in the Package Explorer view.

Is it okay if I FTP the required files from the server location in the Linux machine and copy them in the client?

Similarly in Page 29, I need to import certain files from JazzTeamServer\server\conf\jts\sites\license-update-site. Can I again FTP these files from the Linux machine to Windows, put it in any location and import from there?

Kindly guide me.

Thanks,
Ananya

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.