Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

nFeed users: What is the SQL for Component?

Jonathan Smith
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 3, 2019

Hello all!

  I have 2 nfeed sub fields that populate values based on the selection in nfeed field project category.

  • nfeed field 1: Project category
  • nfeed field 2: Project sub category
  • nfeed field 3: Project 3rd category

My current setup works... but if I wanted to utilize components for Project category, what would be the code in the WHERE statement below?

Select [SubcategoryValue]
FROM [dbo].[ProjectCategory] PC
LEFT JOIN [dbo].[SubCategory] SC
ON PC.ProjectCategoryID=SC.ProjectCategoryID
WHERE PC.ProjectCategory= '$issue.customfield_11330'

I essentially want to replace the nfeed custom field id with the value in the component field.

Thanks,

Jonathan

1 answer

0 votes
Nicolas Esteves
Contributor
June 3, 2019

Hi @Jonathan Smith

I think what you want is a query like that:

Select [SubcategoryValue]
FROM [dbo].[ProjectCategory] PC
LEFT JOIN [dbo].[SubCategory] SC
ON PC.ProjectCategoryID=SC.ProjectCategoryID
WHERE PC.ProjectCategory in ($issue.components.stringList())

Do you confirm?

Kind regards,

Suggest an answer

Log in or Sign up to answer