Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
I wanted to use the "id" form of refnames, which requires knowing the CSID before importing, so I made some changes in your ruby script that might be of some interest.
To get a new UUID:
require 'uuidtools' # can be installed with apt-get. There is also a rubygems version for yum
csid = UUIDTools::UUID.random_create
f.write( " <import service=\"Persons\" type=\"Person\" CSID=\"#{csid}\">\n" )
Followed by a little string munging to inject the csid variable into the refname, something like:
(the schema string).sub( /person:name\([^ )]*\)/, "person:id(#{csid})" )
Patch with temporary workaround for CSPACE-3911 in the Ruby script above (This patch is no longer needed, due to the workaround put in place on the Imports Service in CSPACE-3911 as of early October 2011.)
Glen Jackson commented on the Ruby script above:
I wanted to use the "id" form of refnames, which requires knowing the CSID before importing, so I made some changes in your ruby script that might be of some interest.
To get a new UUID:
require 'uuidtools' # can be installed with apt-get. There is also a rubygems version for yum csid = UUIDTools::UUID.random_create f.write( " <import service=\"Persons\" type=\"Person\" CSID=\"#{csid}\">\n" )Followed by a little string munging to inject the csid variable into the refname, something like:
(the schema string).sub( /person:name\([^ )]*\)/, "person:id(#{csid})" )