Hi,
We need to develop functionality for creating components in projects using the sil script.
To do this, we will use the routine: admAddProjectComponent ()
But to do this, you need to check for the presence of certain components in the project. How can I make a check also via the sil script?
Correct! I believe that admGetProjectComponent should not work like this. Anyway do not check if component exists or not. Just use
admAddProjectComponent("VTBTOP", "TEST", "Verify the addition of components.", "",0);
If such a component exists it will not create a new one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Messages disappeared somewhere...
@Alexey Matveev ,
I try to execute the script in your example, but it gives an error:
Exception while executing SIL program >>null<<: [SIL Error on line: 1, column: 14] Project component is null!
Script:
if(isNotNull(admGetProjectComponent("VTBTOP", "TEST"))){
admAddProjectComponent("VTBTOP", "TEST", "Verify the addition of components.", "",0);
}
What could be the mistake?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Helen Porter ,
You can use admGetProjectComponent:
https://confluence.cprime.io/display/SIL/admGetProjectComponent
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Alexey Matveev ,
Thank you!
But I don’t understand how to write a condition to search for a specific component? For example, we need to check for the presence of a component called Test in the JIRASUPP project.
How to make a condition for the design:
if( ){
}
?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alexey Matveev ,
I try to execute the script in your example, but it gives an error:
Exception while executing SIL program >>null<<: [SIL Error on line: 1, column: 11] Project component is null!
Script:
if(isNull(admGetProjectComponent("VTBTOP", "TEST"))){
admAddProjectComponent("VTBTOP", "TEST", "Verify the addition of components.", "",0);
}
What could be the mistake?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.