You need to sign in to do that
Don't have an account?

Javascript button to lightning component
Looking for some guidance on converting the following Javascript button as we move over to Lightning.
if('{!Case.BugNumber__c}' == '') {
if('{!TEXT(Case.Reason)}' == '') {
alert('NO! NO! NO! Case Reason must be selected before you can create a TFS Issue! So sorry. Try again with feeling this time!');
} else {
window.open(
'http://abc.defgh.local:8080/tfs/DesktopProductsCollection/Products/_workItems/create/{!IF(ISPICKVAL(Case.Reason,"xxxProduct (http://tfs.tituscorp.local:8080/tfs/DesktopProductsCollection/Products/_workItems/create/%7b!IF(ISPICKVAL(Case.Reason,%22xxxProduct) Issue (Bug)"), "Bug", "Issue")}?%5BSystem.Title%5D={!URLENCODE(Case.Subject)}&%5BSystem.AreaPath%5D=Products&%5BMicrosoft.VSTS.Common.Priority%5D=3&%5BMicrosoft.VSTS.Common.Severity%5D=3)+Medium&%5BUniversalCont.CaseID%5D={!Case.CaseNumber}&%5B{!IF(ISPICKVAL(Case.Reason,"xxxProduct Issue (Bug)"), "Microsoft.VSTS.Build.FoundIn", "UniversalCont.Version")}%5D={!Case.Version__c}&%5BUniversalCont.CustomerID%5D={!Account.Name}&%5BUniversalCont.Source%5D={!IF(ISPICKVAL(Account.Type, "Customer"), "Support", "Support")}&%5BSystem.Description%5D=%3Ca+href%3D%22{!URLENCODE(Case.dev_view_link__c)}%22%3EView+Case%3C%2Fa%3E+/+%3Ca+href%3D%22{!URLENCODE(Case.dev_ping_link__c)}%22%3EPing+Support%3C%2Fa%3E%3Cbr+%2F%3E{!IF(LEN(URLENCODE(Case.Description)) > 1000, "%3Cbr+%2F%3EEXTRA LONG DESCRIPTION....%3Cbr+%2F%3EPLEASE COPY DESCRIPTION MANUALLY FROM SF CASE%3Cbr+%2F%3EBUT LEAVE LINKS ON FIRST LINE ABOVE.", URLENCODE(Case.Description))}'
);
}
}else{
alert('TFS Number already exists in this case!!');
}
Thanks in advance.
if('{!Case.BugNumber__c}' == '') {
if('{!TEXT(Case.Reason)}' == '') {
alert('NO! NO! NO! Case Reason must be selected before you can create a TFS Issue! So sorry. Try again with feeling this time!');
} else {
window.open(
'http://abc.defgh.local:8080/tfs/DesktopProductsCollection/Products/_workItems/create/{!IF(ISPICKVAL(Case.Reason,"xxxProduct (http://tfs.tituscorp.local:8080/tfs/DesktopProductsCollection/Products/_workItems/create/%7b!IF(ISPICKVAL(Case.Reason,%22xxxProduct) Issue (Bug)"), "Bug", "Issue")}?%5BSystem.Title%5D={!URLENCODE(Case.Subject)}&%5BSystem.AreaPath%5D=Products&%5BMicrosoft.VSTS.Common.Priority%5D=3&%5BMicrosoft.VSTS.Common.Severity%5D=3)+Medium&%5BUniversalCont.CaseID%5D={!Case.CaseNumber}&%5B{!IF(ISPICKVAL(Case.Reason,"xxxProduct Issue (Bug)"), "Microsoft.VSTS.Build.FoundIn", "UniversalCont.Version")}%5D={!Case.Version__c}&%5BUniversalCont.CustomerID%5D={!Account.Name}&%5BUniversalCont.Source%5D={!IF(ISPICKVAL(Account.Type, "Customer"), "Support", "Support")}&%5BSystem.Description%5D=%3Ca+href%3D%22{!URLENCODE(Case.dev_view_link__c)}%22%3EView+Case%3C%2Fa%3E+/+%3Ca+href%3D%22{!URLENCODE(Case.dev_ping_link__c)}%22%3EPing+Support%3C%2Fa%3E%3Cbr+%2F%3E{!IF(LEN(URLENCODE(Case.Description)) > 1000, "%3Cbr+%2F%3EEXTRA LONG DESCRIPTION....%3Cbr+%2F%3EPLEASE COPY DESCRIPTION MANUALLY FROM SF CASE%3Cbr+%2F%3EBUT LEAVE LINKS ON FIRST LINE ABOVE.", URLENCODE(Case.Description))}'
);
}
}else{
alert('TFS Number already exists in this case!!');
}
Thanks in advance.