Hello.
I'm struggling with a small but annoying problem. How can I get a value of customfield of other issue?
I'm trying to compare creation dates of linked issues, yet structure like otherissuekey.customfield_00000 is not working properly.
I will appreciate any help, especially that somehow documentation of Kepler Rominfo plugins seems to be down at the moment.
Hi,
You can get value like this: #{%otherissuekey%.customfield_00000}
That is correct.
Just to add a bit to the explanation, there are 2 ways in which you can accomplish this.
1. using the issue key directly e.g. TEST-1.customfield_00000
2. using substitution for the issue key:
string otherissuekey = "TEST-1"; // could be anything that sets a valid issue key to this variable
%otherissuekey%.customfield_00000;
Note: the use of #{} is only needed if you are using the custom field name and it contains whitespaces, otherwise it is optional.
If you're still having trouble with the syntax, please give a script snippet that show exactly how you're using it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks guys, that's a really detailed description that helped me to immediately solve my problem :)
Unfortunately I bumped on another one. Now when I use %my_variable_containing_key%.created I get following error in logs:
"Caused by: com.keplerrominfo.jira.commons.sil.SILInfoException: [SIL Error on line: 8, column: 38] Variable >>.created<< is not a custom field."
Do I have to use different construction when I try to get value of system field?
Here is my whole SIL code:
string[] my_linked_issues_array = linkedIssues(parent); string my_loop_index; string my_current_issue_key = key; string my_linked_issue_key; for(my_loop_index in my_linked_issues_array){ my_linked_issue_key = my_linked_issues_array[my_loop_index]; if (%my_linked_issue_key%.created >= #{%my_current_issue_key%.customfield_10900}){ linkIssue(key, my_loop_index, "Relates"); } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The for each construction iterates through values not indexes, so the "my_linked_issue_key" will get the value of array["some key"] which is null.
for( x in array) {
// x is element, not index
}
Instead, try this:
for(my_linked_issue_key in my_linked_issues_array){ if (%my_linked_issue_key%.created >= #{%my_current_issue_key%.customfield_10900}){ linkIssue(key, my_linked_issue_key, "Relates");
} }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The documentation should be visible online, our providers are having problems with the heat outside :)- It was a brief interruption of about 10 minutes. There are something like 313 K (40C/100F) outside.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the info :)
No worries, few days ago we have had similiar temperatures here, so I know what you feel ;) Be cool! :D
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.