(JIRA) Copy "component watcher" entries into list of "Watchers" - jira

I want to copy the list of users specified as Component Watchers (with the plugin of the same name) into the list of Watchers, at issue creation time. I'm trying to do this with a Script-Runner post-function, after creating a custom field of type Component Watchers.
The part that I'm missing is how to obtain the Component Watchers usernames as a list. Any idea?

Try the Behaviours plugin. There you can specify "behaviour"-s, that can be mapped to projects and issue types, and there you can specify Groovy Scripts to run during transitions.
It won't be easy, but it is versatile and does not eat too much resources.

Related

Deletion of module columns/attribute not visible on a given View

I have been given the task of creating a DXL script. First problem is that I have never used DXL before, even though I have many years experience with DOORS itself. I have been surfing the Net to seek guidance on my particular problem. I also have a few specimen DXL scripts for reference.
My new client requires that for each View of a given Module, of which there are many Views, new "reduced" Modules are to be produced reflecting each View.
By "reduced", I mean that these new Modules are to contain nothing that isn't actually needed for that View., i.e. Columns, Attributes etc. These new Modules will only have the single View.
So, the way forward as I see it, is to take copies of the single master Module, one for each View, rename those copies to reflect a given Master Module/Required View, select that required View in the given copy Module and then delete everything that is not needed by that View, i.e. available Columns, Attributes etc.
This would be simple if I had the required DXL knowledge, which I am endeavouring to pick up as fast as I can.
If at all possible, this script has to be generic and be able to work upon any of the master Module copies to produce the associated "reduced" Module reflecting a particular View.
The client aims to use the script periodically for View archiving (I know, that's the way they want it).
Clarification
Some clarification of what I believe is required, given the following text from my original question:
If at all possible, this script has to be generic and be able to work upon any of the master Module copies to produce the associated "reduced" Module reflecting a particular View.
So, say there are ten views of the master Module, outside of the DXL script, I would copy the master Module ten times, renaming each copy to reflect each of the ten views. Unless you know different, each of those ten copies will reflect the same “Absolute Number”s as are in the master Module, so no problem there?
So, starting with the first of the copied Modules, each named to reflect the View it will eventually represent, its View would be set from the ten Views available to it, that which matches its title.
The single generic DXL script would then be run against that first copy Module, the aim being to delete everything not actually needed for that view, i.e. Attributes, Columns etc. Would some kind of purging command be required in the script for any aforementioned deleted items?
The single generic DXL script would then delete ALL views from that copy Module. The log that is produced when running the script also needs capturing, but I’m not sure whether this should be done from within the script, if possible or as a separate manual task outside of the script.
The aforementioned (indented) process would then be repeated, using the same generic script, against the remaining nine copied Modules. The intension is to leave us with ten copy Modules, each one reflecting one of the ten possible Views, with each one containing only the Attributes, Columns etc. required for that View.
Creating a mirror of a module with this approach is not so easy IMO. Think e.g. about "Absolute Number". If the original module contains the numbers 15 (level 1), 2000 (level 2), 1 (level 1), you will have to create 2000 objects, purge 1997 of them and move them to the correct place.
There is a "duplicate" tool at https://www.ibm.com/developerworks/community/forums/html/topic?id=43862118-113d-4eac-b3f1-21d3b73959d1 which tries to do this, but as stated there, this script is said not to work correctly in all situations.
So, I would rather use the approach "string clipCopy (Item i); string clipPaste(Folder folderRef)". Should be faster and less error prone. But: all Out-Links will also be copied with this method, you will probably have to delete these after the copy or else the link target module(s) will have lots of In-Links.
The problem is still not so easy to solve, as every view might have DXL columns that rely on some or other attribute, and it might contain DXL attributes which again might rely on sth else. I doubt that there is a way to analyze DXL code "on the fly" and find out which columns may be deleted.
Perhaps a totally different approach would be feasible: open each view and create an export to Excel, this way you will get rid of any dynamic dependencies. Then re-import the excel sheet to a new DOORS module. You will still have the "Absolute Number" problem, but perhaps you can make a deal that you will have a pseudo attribute "Original Absolute Number" and disregard the "new" "Absolute Number"'
Quite a big task for a DXL beginner....
Update: On second thought, perhaps you might want to combine these approaches
agree with your employer that you will use an alternative attribute for Absolute Number
use a loop like Russel suggested, when creating objects remember that objects might have to be created "below" or "after" its predecessor or sibling
for DXL attributes do not copy the DXL code but the actual current value of the object
for DXL columns create pseudo attributes _ and create a new view that uses these pseudo attributes instead of the original value
Copying the entire module, then deleting everything not in that view, seems worse than just copying the things you need from each particular view.
I would take the following as the outline of your program:
for view in main module do {
for column in view do {
Find attribute for each column and store (possibly in a skip list?)
Store name of column
}
create new module
create needed types / attributes in new module
create new view in new module
for object in main module {
create object in new module
for attribute in main module {
check if attribute is in new module {
copy info from old object to new
}
}
}
}
Each of these for X in y loops should be in the DXL reference manual in some for or another.
If you need more help, let me know!

Fetch Codes from SVN using properties file

I have a scenario, where using ANT Script I have to fetch codes from SVN using properties file.
The properties files has the property projectlib where the libraries used in a module are listed as comma separated values and their corresponding revision numbers are listed in a property projectlib.revision below.
I have to fetch projectlib with the respective revision number.
The properties file looks as below:
projectliblist=XXXXLib1,XXXXLib2
projectlibrevision=3195,3289
For Example, here I have to fetch XXXXLib1 from 3195 and XXXXLib2 from 3289.
I need the logic to match projectlib with respective revision number, not the complete script for this scenario.
I tried with For list, but I don't know how to index the param list.
The problem you will have with the pair of list properties you show is that (at least using ant-contrib:for) you don't have a way to cross-refer them.
This answer shows how you can readily cross refer properties using ant-contrib:for / macrodef and might be useful as an example.
For your case, I'd suggest you change the properties structure to be more consumable in Ant, for example:
projectliblist=XXXXLib1,XXXXLib2
projectlib.XXXXLib1.revision=3195
projectlib.XXXXLib2.revision=3289
which you could consume following the pattern in the answer I linked to above, or possibly:
projectliblist=XXXXLib1/3195,XXXXLib2/3289
which you could consume in a loop which splits each list element into two parts and passes to a macrodef with two attributes.

How decides Typo3 Neos which Settings.yaml to choose?

i use one Neos installation for multiple domains with different content.
duplicating the package TYPO3.NeosDemoTypo3Org, removing the node-identifier and doing some replacements brought me nearby everything i need.
But only the first Settings.yaml found in Packages/Sites/ seems to be parsed. All changes to the Settings.yaml found in other packages (Test1 and Test2 in the following example) are ignored.
Packages/Sites/TYPO3.NeosDemoTypo3Org/Configuration/Settings.yaml
TYPO3:
Form:
yamlPersistenceManager:
savePath: 'resource://TYPO3.NeosDemoTypo3Org/Private/Form/'
Packages/Sites/UDF.Test1/Configuration/Settings.yaml
TYPO3:
Form:
yamlPersistenceManager:
savePath: 'resource://UDF.Test1/Private/Form/'
Packages/Sites/UDF.Test2/Configuration/Settings.yaml
TYPO3:
Form:
yamlPersistenceManager:
savePath: 'resource://UDF.Test2/Private/Form/'
When i delete the first Settings.yaml (Packages/Sites/UDF.Test2/Configuration/Settings.yaml), the next Setting.yaml in alphabetical order (Packages/Sites/UDF.Test1/Configuration/Settings.yaml) is used for all 3 site packages. When i also delete this file, the Settings.yaml from UDF.Test2 is used and so on.
would be awesome if somebody can enlighten me. I am new to flow and neos and any help is welcome. RTFM, i know, but as described here i have to believe, that it should work like i did?
alternative way?
is it possible not to set the savePath in the site package configuration but in the common settings ./Packages/Application/TYPO3.Form/Configuration/Settings.yaml
I see a {#package} placeholder in
### BASE ELEMENTS ###
# NAMING: base class for everything is RENDERABLE
'TYPO3.Form:Base':
renderingOptions:
templatePathPattern: 'resource://{#package}/Private/Form/{#type}.html'
but this doesn't work here
TYPO3:
Form:
yamlPersistenceManager:
#savePath: '%FLOW_PATH_DATA%Forms/'
savePath: 'resource://{#package}/Private/Form/'
as you see i am not really experienced with this stuff but i am very motivated.
All Settings.yaml are used, but the settings are merged in order of the package loading.
The loading order of packages again is based on their dependencies.
All three packages probably have the same dependencies so they are loaded one after the other (would need to check with which ordering), so third Settings.yaml is loaded, then second Settings.yaml is loaded and overwrites the third, then the first is loaded and again overwrites the second. Every setting path can only be set once, that's why.
In any case what you are trying to archive probably won't work. This is one of the things we have to fix (site package dependent configuration).
A possible workaround is either using a common package with the form configuration and just set the savePath to this package or using diferent subcontexts (like Production/Domain1 Production/Domain2) and setting this setting different per subcontext, then you could define the subcontext by domain (as the sites are triggered by domain anyway).

How does TFS's convertworkspaceitem work?

I'm trying to follow the instructions for deploying a database via TFS build listed here:
http://www.mytechfinds.com/articles/software-testing/6-test-automation/64-db-deployment-tfs
The instructions include notes about how to configure a ConvertWorkspaceItem element. I've followed the directions, but TFS remains unhappy with my setting for 'Result' and 'Workspace'. For now, I simply entered the text from the directions ('dbproj' and 'Workspace', respectively). TFS complains about my values:
Compiler error(s) encountered processing expression "dbproj". 'dbproj' is not declared. It may be inaccessible due to its production level.
I'm trying to find basic tutorial information on the ConvertWorkspaceItem element, but other than the MSDN reference page there isn't a lot of info. Does anyone know much about configuring this element?
You need to specify valid variable names for both of these properties. there should already be a variable declared in the workflow called workspace, You will need to declare a variable of type string that you wish to receive the result of this activity and specify it's name as the Result property. It looks like in your linked article the author must have already created a variable called dbproj. At the bottom of the workflow designer is a variables tab where you can define your own variables.

Can I compile 2 build templates in the same solution?

I've got a class library project set up to do template editing and wanted to drop in another copy and customize it. However I get
The type 'TfsBuild.Process' already contains a definition for '_contentLoaded'
and 22 more of the same with the other _ names.
Also Type 'TfsBuild.Process' already defines a member called 'Process' with the same parameter types C:\Projects\MSBuild.Tasks\TechnicalDebtTaskLib\BuildProcessTemplate\obj\Release\CodeMetric.g.cs 62 16 BuildProcessTemplate
i've tried hand editing different parts of the xaml to try to find what key might need to be more unique, but no luck.
How do I work on multiple build process templates in the same solution or copy a process template that makes it unique?
Summary:
<activity mc:ignorable="sap" x:class="Tfs2008Template.Process" ... xmlns:this="clr-namespace:Tfs2008Template">
two tags must be changed for example:
<activity mc:ignorable="sap" x:class="Tfs2008Template2.Process" ... xmlns:this="clr-namespace:Tfs2008Template2">
For whatever reasoning the two tags that are related and need to be in sync are usually at the beginning and end of a very long list of attributes.
Full Article on my blog

Resources