How to (re)create and delete comments depends on custom fields?
Hi,
I try to complete this workflow scenario:
I defined custom string field named extDoc. Then I wrote this rule:
rule Add link to extDoc to task description
when extDoc.changed && extDoc!=null {
addComment("http://docstore.ourcompany.net/view.php?id="+extDoc);
}
That works fine and create hyperlink to comments. But now I need to find all such comments and delete them before I create new one - goal is to have maximum one hyperlink to actual version of external documentation.
I try to write it in pseudocode:
rule Add link to extDoc to task description
when extDoc.changed {
for each comment in comments {
if (comment.text.contains("http://docstore.ourcompany.net/view.php?id=") {
removeComment(comment);
}
}
if(extDoc!=null){
addComment("http://docstore.ourcompany.net/view.php?id="+extDoc);
}
}
Problems:
Any advice how to solve this?
Thx a lot!
I try to complete this workflow scenario:
I defined custom string field named extDoc. Then I wrote this rule:
rule Add link to extDoc to task description
when extDoc.changed && extDoc!=null {
addComment("http://docstore.ourcompany.net/view.php?id="+extDoc);
}
That works fine and create hyperlink to comments. But now I need to find all such comments and delete them before I create new one - goal is to have maximum one hyperlink to actual version of external documentation.
I try to write it in pseudocode:
rule Add link to extDoc to task description
when extDoc.changed {
for each comment in comments {
if (comment.text.contains("http://docstore.ourcompany.net/view.php?id=") {
removeComment(comment);
}
}
if(extDoc!=null){
addComment("http://docstore.ourcompany.net/view.php?id="+extDoc);
}
}
Problems:
- I don't know any command like "removeComment"
- comment.text.contains doesn't work, it shows error message. comment.text is ok, but .contains is problem - probably not available in this context.
Any advice how to solve this?
Thx a lot!
Please sign in to leave a comment.
comment.text.contains() works for me, do you get it in completion Ctrl+Space?
comment.text.contains
as a result I get an error.
When I use completion via Ctrl+Space and select "contains", it works.
OK, when "removeComment" is not available, how to at least change the current comment text? Is a way how to manage it?
I tryied comment.text = "some new value", but doesn't work. Thx a lot for any idea.
ruleAdd link to external documentation to task description
when extDoc.changed{
var addNew = true;
for each comment in comments{
if(comment.text.contains("http://docstore.ourcompany.net/view.php?id=",ignoreCase)||comment.text.contains("Link to doc deleted",ignoreCase)){
if(extDoc!=null){
comment.text="http://docstore.ourcompany.net/view.php?id="+extDoc;
addNew=false;
}else{
comment.text="Link to doc deleted";
addNew=false;
}
}
}
if(addNew==true){
addComment("http://docstore.ourcompany.net/view.php?id="+extDoc);
}
}
It works. The only problem is, that I'm not adding comments and so comments list doesn't refresh at all. I need to reload page in browser (e.g. F5 key) to see changed comments. Is there any way how to force comments refresh?
Thx
Unfortunately, there is no 'removeComment()' method in the workflow.
http://https://bestcellular.com/product/simglw416c/
Unfortunately, there is no 'removeComment()' method in the workflow. http://https://bestcellular.com/product/simglw416c/
Unfortunately, there is no 'removeComment()' method in the workflow. SIMGLW416C
Unfortunately, there is no 'removeComment()' method in the workflow. http://SIMGLW416C 0
Unfortunately, there is no 'removeComment()' method in the workflow. http:// SIMGLW416C